-Clinton
Sad to say you're probably out of luck. Firefox's Screengrab extension
[1] used to use Java to grab an area of the screen, but I doubt this can
be done from an unsigned applet in the browser [2]. Also there'd be the
issue of trying to figure *which* area to grab.
[1] http://www.screengrab.org/home/features/implementation/
[2] http://www.brendonwilson.com/projects/signed-java/
--
Steve Clay
http://mrclay.org/
No, he is talking about the toDataURL function which dumps the canvas
to an image..
http://developer.mozilla.org/en/docs/Code_snippets:Canvas
Firefox does this and he is asking if the exCanvas implementation
supports it..
> Does ExplorerCanvas support some version of toDataURL() for IE? I need
> to be able to pull image data out of a <canvas> and post it to the
> server, but I get a method-not-found error when attempting to call
> toDataURL() in both IE 6 and 7.
I'm not sure but would assume that it is not supported.. Depending on
how simple your canvas drawings are, it should be trivial to send the
canvas data to the server, either as SVG, or convert to SVG on the
server and then run it through an image converter (http://
www.imagemagick.org/) to get a .png or .jpg.. The nice thing about
toDataURL() is that transfer to the server is not needed so you can
allow the user to save the image locally (see mozilla link above), but
in your case the server is the destination anyway..
Hope that helps,
-Ed
Yes, exactly... it works perfectly in Firefox.
> I'm not sure but would assume that it is not supported.. Depending on
> how simple your canvas drawings are, it should be trivial to send the
> canvas data to the server, either as SVG, or convert to SVG on the
> server and then run it through an image converter (http://
Right, I'm already using ImageMagick on the server side, so it doesn't
matter what format the data gets posted in... PNG, SVG, and VML are
all equally usable. I can even do a check on the client side and use
toDataURL() if the browser is Firefox, or post the SVG/VML data if
it's IE, then let ImageMagick sort it all out. The only missing piece
is, I don't know how to extract the SVG/VML source from the <canvas>
in order to post it... if it's trivial, can you point me in the right
direction for a code snippet? Thanks much.
-Clinton
Sorry I wasn't clearer, I did know he was referring to toDataURL() but I
missed that he could use VML. excanvas places VML elements inside the
canvas element, so one crude way to serialize them is:
canvasDomElement.innerHTML