Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I try to download a png file. When there is a image on canvas, I add an image to canvas and call toDataURL it shows

I try to download a png file.

When there is a image on canvas, I add an image to canvas and call toDataURL it shows me a blank page, and data url is also blank.

image text in transcribedimage text in transcribedimage text in transcribed

downloadCanvasAsPng (elementId, link, smiles, itemName) I let canvas; canvas document.getElementById(elementId); //link.href canvas.toDataURL); //link. download = smiles +-+ itemName + .png"; link = document.createElement('a'); const fileName = smiles +-' + itemName + '.png"; link.download fileName; const fileUrl-canvas . toDataURL(); link.href - fileUrl; link.target"_self'; link.click()

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

(a) Evaluate: cos 4 d , correct to 4 significant figures. 0

Answered: 1 week ago

Question

What is the purpose of the Salary Structure Table?

Answered: 1 week ago

Question

What is the scope and use of a Job Family Table?

Answered: 1 week ago