I basically want to put the shape that the user “cuts” from the main canvas to a random place in the main canvas. I keep the context of the selection form and want to use;
ctx.drawImage(gctx,corx,cory);
to put gctx, which contains the cut context in ctx, which is the main canvas context. Both are global and are already installed when they step on the above line of code. Also gctx is installed below:
ghostcanvas = document.createElement('canvas'); ghostcanvas.height = canvas.height; ghostcanvas.width = canvas.width; gctx = ghostcanvas.getContext('2d');
From firebug I see that there is a context in gctx, ctx also exists. So what am I doing wrong?
Forgot to add the error message I received;
The type of the object is incompatible with the expected type, the parameter associated with the object "code:" 17 [Break On This Error] ctx.drawImage (gctx, corx, Cory);
Thanks in advance, sorry in advance if this is an important question for beginners,
source share