javascript - Is there an onload function for html canvas? -


My goal is to create an array of image data from a series of png images.

To do this, I am using the loop to go through the images, put them in the canvas, and then retrieve and store the image data created in an array.

The problem is that there is not enough time in the image load in the canvas. My solution is to leave a timer enough time for now, but it is terrible.

I can not find any solution to this problem. Is there an "onload" function for canvas?

 for  (var i = 1; i & lt; 50; i ++) {(function (i) {setTimeout (function () {return function () {var newpath = path Path to image + i + ".png" baliseimg.onload = function () {// baliseimg: html image tag ctxt.drawImage (baliseimg, 0,0); ctxt imaged IGS [I-1] = CTTX.Get image data ( 0,0,512,512);} To print the image number at Belizeim SRC = Newpath;} ();} .Filtext (I, 50, 50); //, 100 * i); // 100 mms work, limit 40 Looks at (i)); }   

Thanks for your time.

No, according to

but you still img canvas manipulation to use the code> Elements' Olload . Can help you.

Great chance!

Comments

Popular posts from this blog

Pass DB Connection parameters to a Kettle a.k.a PDI table Input step dynamically from Excel -

multithreading - PhantomJS-Node in a for Loop -

c++ - MATLAB .m file to .mex file using Matlab Compiler -