154
rated 0 times
[
161]
[
7]
/ answers: 1 / hits: 43932
/ 13 Years ago, tue, march 15, 2011, 12:00:00
Is there any way to obtain the canvas that a context is used for?
Why I'm asking is because I'm creating a prototype function for CanvasRenderingContext2D
in which I need the width/height of the canvas element.
E.g.:
var cv = document.getElementById('canvas');
var ctx = cv.getContext('2d');
// Using only 'ctx', how to get 'cv'?
More From » html5-canvas