Reputation: 11
I want to set context of canvas1 to canvas2.
I saw here - https://developers.whatwg.org/the-canvas-element.html#dom-canvas-setcontext
that setContext() is supported but I get an error of undefined function in chrome.
var canvas1 = document.getElementById("myCanvas1");
var canvas2 = document.getElementById("myCanvas2");
ctx1 = canvas1.getContext("webgl");
var gl = canvas2.setContext(ctx1);
why it happened? how can I set context of canvas from another canvas's context?
Upvotes: 0
Views: 1064