gliffy / canvas2svg

Translates HTML5 Canvas draw commands to SVG
MIT License
683 stars 155 forks source link

Set image 'opacity' attribute in drawImage method #53

Open kinimesi opened 6 years ago

kinimesi commented 6 years ago

Set opacity attribute of images. Right now, the opacity is always 1 in converted SVG files, try the following:

ctx.globalAlpha = 0.5;
var img = new Image();
img.src = "https://www.w3schools.com/tags/img_the_scream.jpg"

ctx.drawImage(img, 0, 0);
mudcube commented 6 years ago

This pull request works. @webspinner Any chance of getting this merged in? Thanks!