Skip to content Skip to sidebar Skip to footer

HTML5 Canvas Layer Issue

I have similar issue with layers as described here html5 - canvas element - Multiple layers But, accepted answer doesn't work for me, as for layer1 I have rendered image (drawImage

Solution 1:

You are setting ctx2 to layer1's context:

ctx2 = canvas.getContext("2d");

Of course, since the image loads asynchronously, the onload event fires after you've already drawn the gradient, and it gets drawn on the same canvas.


Post a Comment for "HTML5 Canvas Layer Issue"