natashawylie / iviewer

image viewer plugin for jquery
233 stars 97 forks source link

Change image with canvas #7

Closed umbobabo closed 11 years ago

umbobabo commented 13 years ago

Hi, I think iviewer works very well.

Do you think it's possible to change img tag with HTML5 canvas tag? I tried to change some part like this.img_object.object = $("") on row 129 but with no luck.

can3p commented 13 years ago

This can be done, but some additional work is required. First of all, you have to load image via Image object and then copy it to canvas with drawImage method. After that, you need to draw visible part of image on the drag and zoom event - everywhere, where image state is changed.