Does getImageData not work in IE at all?

2,026 views
Skip to first unread message

Fraction

unread,
Jul 14, 2009, 4:53:54 PM7/14/09
to google-excanvas
Just like the subject says. Having problems trying to use
getImageData in any version of IE. Is there a fix to this or am I
just up a river with no paddle?

EX CODE: (mootools framework) _image is passed in the function
parameters

var canvas = new Element( 'canvas' );
canvas.width = _image.width;
canvas.height = _image.height;

if ( typeof G_vmlCanvasManager != 'undefined' ) {

G_vmlCanvasManager.initElement( canvas );

}

var canvasContext = canvas.getContext( '2d' );
canvasContext.drawImage( _image, 0, 0 );
// the next line is where it comes to a screeching halt in IE.
bummer.
var imageData = canvasContext.getImageData( 0, 0, _image.width,
_image.height );

Emil A Eklund

unread,
Jul 14, 2009, 5:14:47 PM7/14/09
to google-...@googlegroups.com
On Tue, 2009-07-14 at 13:53 -0700, Fraction wrote:
> Just like the subject says. Having problems trying to use
> getImageData in any version of IE. Is there a fix to this or am I
> just up a river with no paddle?

ExCanvas does not support any of the ImageData functions (createImageData, getImageData, putImageData).
Given the way it's implemented it's highly unlikely that we'll be able to add support for it in the VML implementation of ExCanvas.
It should be doable in the Silverlight version but we haven't spent much time on that lately.

ExCanvas supports most of the functionality as specified in the initial apple canvas spec but few of the additions added by the gecko implementation and later speced by html5 working group. The reason being fairly simple, ExCanvas uses VML to do the actual drawing and many of the additions (such as getImageData) requires pixel level access which isn't provided by VML.

Your best bet for now would be to keep track of all commands used to draw the canvas and use those to generate an image server side.

--
Emil A Eklund
em...@eae.net

signature.asc

Fraction

unread,
Jul 14, 2009, 6:03:59 PM7/14/09
to google-excanvas
What a bummer. Oh well. Server side solution here I come! Thanks
for the very speedy response!
> e...@eae.net
>
>  signature.asc
> < 1KViewDownload

Emil A Eklund

unread,
Jul 14, 2009, 6:10:45 PM7/14/09
to google-...@googlegroups.com
On Tue, 2009-07-14 at 15:03 -0700, Fraction wrote:
> What a bummer. Oh well. Server side solution here I come! Thanks
> for the very speedy response!

Yeah it's a serious limitation but one that is pretty hard to overcome.
If you create a working server side implementation please consider
sharing it as others might find it useful as well.

Thanks.

signature.asc

Fabien Ménager

unread,
Jul 14, 2009, 6:19:14 PM7/14/09
to google-excanvas
A discussion about it began here : http://code.google.com/p/explorercanvas/issues/detail?id=41
I would like these methods to work too, I'd like to help if anyone
wants to make it work.
> e...@eae.net
>
>  signature.asc
> < 1KViewDownload
Reply all
Reply to author
Forward
0 new messages