greatwar93 / gwt-g2d

Automatically exported from code.google.com/p/gwt-g2d
0 stars 0 forks source link

Surface getImageData doesn't work in IE #25

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Hi we have some problem with surface.getImageData() method with IE. 

1. Implement onModuleLoad in the following way:
    public void onModuleLoad() {
        Surface surface = new Surface();
        RootPanel.get().add(surface);

        surface.setStrokeStyle(KnownColor.RED);

        ShapeBuilder builder = new ShapeBuilder();
        builder.moveTo(0, 0);
        builder.drawLineTo(50, 50);
        builder.drawLineTo(0, 50);
        surface.strokeShape(builder.build());

        try{
            surface.getImageData(0, 0, 50, 50);
        } catch (Throwable e){
            e.printStackTrace();
        }
    }

2. build and test in Firefox/Chrome - perfect
3. test in IE - nothing is appears

What is the expected output? What do you see instead?
We expect that 
surface.getImageData(0, 0, 50, 50); 
returns instance of ImageDataAdapter, but we have following exception:
com.google.gwt.core.client.JavaScriptException: (TypeError): Object doesn't 
support this property or method
 number: -2146827850
 description: Object doesn't support this property or method
    at com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:237)
    at com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:129)
    at com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:561)
    at com.google.gwt.dev.shell.ModuleSpace.invokeNativeObject(ModuleSpace.java:269)
    at com.google.gwt.dev.shell.JavaScriptHost.invokeNativeObject(JavaScriptHost.java:91)
    at gwt.g2d.client.graphics.canvas.ContextImpl$.getImageData$(ContextImpl.java)
    at com.google.gwt.core.client.JavaScriptObject$.gwt_g2d_client_graphics_canvas_Context_getImageData(JavaScriptObject.java)
    at gwt.g2d.client.graphics.Surface.getImageData(Surface.java:1094)
    at com.gmail.ousatyy.client.GWTApplicationProject.onModuleLoad(GWTApplicationProject.java:30)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at com.google.gwt.dev.shell.ModuleSpace.onLoad(ModuleSpace.java:396)
    at com.google.gwt.dev.shell.OophmSessionHandler.loadModule(OophmSessionHandler.java:183)
    at com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:510)
    at com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:352)
    at java.lang.Thread.run(Thread.java:662)

What version of the product are you using? On what operating system?
Product version: gwt-g2d-v008.jar/gwt-g2d-devbuild.jar

OS: Windows 7
IE Version: 8.0.7601.17514 64-bit Edition

OS: Windows XP
IE Version: 8.0.6001.18702 32-bit Edition

Please provide any additional information below.

Original issue reported on code.google.com by ousa...@gmail.com on 12 May 2011 at 6:46

GoogleCodeExporter commented 8 years ago
This is a limitation on IE8 and older, which is backed up excanvas.  Many of 
the canvas API will not work on older IE, including but not limited to: image 
pixel manipulation, shadow, clipping, video, radial gradient, etc.  These APIs 
are available on IE9, but there is nothing we can do on the older IE.

Original comment by hao1...@gmail.com on 13 May 2011 at 3:41