How to download an image object from webgl/javascript -
i have directory 100 images. need copy of them in various folders along other information download webgl. hence want upload them onto browser , download them again (hope isn't stupid)
here code:
var imagefile = model.features[cindex].imagename.substring(model.features[cindex].imagename.lastindexof('/')+1); var image = new image(); image.src = model.imagedirectory + imagefile; image.onload = function() { console.info("read \""+image.src + "\"...done"); } image.onerror = function() { var message = "unable open \"" + image.src + "\"."; console.error(message); alert(message); } var data = image.src; zip.file('image_rh_original' + cindex +'.png', data , {base64: true});
is wrong? how similar "todataurl" image object?
todataurl method of canvas, , webgl draws canvas. call canvas.todataurl(). need set preservedrawingbuffer true well.
Comments
Post a Comment