html5 - HTML 5 Canvas draw image over other image -


i have 2 images want draw on 1 canvas. problem first image draw might take longer load second one. since pictures drawn on onload event occur first image drawn on top of second picture.

this not want, want second image drawn on top of first image. ideas?

var imgsrcs = ['url1', 'url2']; // <- put image urls here  var imgs = []; var loaded = 0; var loadcallback = function () {     loaded++;     if (loaded == imgsrcs.length) {         // draw imgs in correct order     } };  (var = 0; < imgsrcs.length; i++) {     imgs[i] = new image();     imgs[i].addeventlistener('load', loadcallback, false);     imgs[i].src = imgsrcs[i]; } 

Comments

Popular posts from this blog

java - SNMP4J General Variable Binding Error -

windows - Python Service Installation - "Could not find PythonClass entry" -

Determine if a XmlNode is empty or null in C#? -