How to resize html canvas element?

Posted by russx2 on Stack Overflow See other posts from Stack Overflow or by russx2
Published on 2008-12-01T14:40:34Z Indexed on 2010/12/23 15:54 UTC
Read the original article Hit count: 185

Filed under:
|
|
|

I have a canvas element defined statically in the html with a width and height. If I attempt to use JavaScript to resize it dynamically (setting a new width and height - either on the attributes of the canvas or via the style properties) I get the following error in Firefox:

uncaught exception: [Exception... "Illegal operation on WrappedNative prototype object" nsresult: "0x8057000c (NS_ERROR_XPC_BAD_OP_ON_WN_PROTO)" location: "JS frame :: file:///home/russh/Desktop/test.html :: onclick :: line 1" data: no]

Is it possible to resize this element or do I have to destroy it and create a new element on the fly?

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about html