Re:Show HN: jsgif: A GIF player in JavaScript
by icode on Monday April 04, 2011 @09:54AM
(#2406380)
Well done! Im looking for a png parser in javascript. I would like to load pngs with xmlhttprequest and them draw them on a canvas. Ever heard of one?
[ Parent
| on HN ]
Why not just do something like the below when you need to do that?
var img = new Image();
img.onload = function(){
//draw to canvas
};
img.src = "image.png";
Could be a stupid answer, or possibly it'd be better to do it your way?( Maybe I can learn something :) )
Re:Show HN: jsgif: A GIF player in JavaScript
by TimothyFitz on Monday April 04, 2011 @10:16AM
(#2406475)
All major browsers will now do this for you, with data: urls. Take a look at the examples here: http://en.wikipedia.org/wiki/Data_URI_scheme
Re:Show HN: jsgif: A GIF player in JavaScript
by capnrefsmmat on Monday April 04, 2011 @10:46AM
(#2406637)
This may be helpful:
https://developer.mozilla.org/en/Canvas_tutorial/Using_image...