2

I'm using the results on a previous Stackoverflow page to combine various layers on an html canvas: drawing images on 3 layer canvas and saving

And the resultant jsfiddle seems to be what I am after. But now what I'm hoping to do is display that final composited image in a pop-up window (sized to the dimensions of the image) which will appear when the user clicks a button, but I am unsure how to do this.

I have thought about using the window.open() command but this seems to only open a pre-created webpage.

PS I am looking for a javascript solution not jQuery, thanks.

Kalamarico
  • 5,056
  • 22
  • 48
  • 68
user3713442
  • 448
  • 6
  • 20

1 Answers1

3

You could pass the img src to the new window

window.open(img.src,"image window",`width=${img.width},height=${img.height}`);

fiddle: http://jsfiddle.net/fhjwY/84/

Gabriele Petrioli
  • 183,160
  • 33
  • 252
  • 304