Re: Is it possible to convert ImageResource to ImageElement?

2012-05-22 Thread Robert Moore
Christopher writes: > > From my experiments, that last example wont work. > > final Image image = new Image(mapResources.map()); > > That line makes GWT try to use a sprite sheet, making the use > style="background:" to display the image. Such an Image won't be shown > when drawn on the canva

Re: Is it possible to convert ImageResource to ImageElement?

2011-03-07 Thread Christopher
>From my experiments, that last example wont work. final Image image = new Image(mapResources.map()); That line makes GWT try to use a sprite sheet, making the use style="background:" to display the image. Such an Image won't be shown when drawn on the canvas. I have to force gwt to use the src=

Re: Is it possible to convert ImageResource to ImageElement?

2011-02-07 Thread Dallas
I've been looking into this same problem and what I've found is a couple of issues. First being that you are not loading the image (ie. not pulling the image from the server), only setting the image properties (eg. url, width, height, etc), so in order to do what you want you would have to call th

Re: Is it possible to convert ImageResource to ImageElement?

2011-02-07 Thread jhulford
I'll admit to knowing nothing about canvas work, but is it possible you have to wait for the image to load using a LoadHandler before you can display it in the Canvas? On Feb 6, 10:46 am, Jambi wrote: > Hej Thomas, > > it´s the same with your solution. The Image won´t appear on the > canvas. Mayb

Re: Is it possible to convert ImageResource to ImageElement?

2011-02-06 Thread Jambi
Hej Thomas, it´s the same with your solution. The Image won´t appear on the canvas. Maybe it is a bug since the canvas api is still experimental? Maybe I should try a different approach to implement an image preloader. On Feb 6, 11:50 am, Thomas Broyer wrote: > Or, without creating an Image widg

Re: Is it possible to convert ImageResource to ImageElement?

2011-02-06 Thread Thomas Broyer
Or, without creating an Image widget: AbstractImagePrototype.create(imageResource).createElement() -- You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To post to this group, send email to google-web-toolkit@googlegroups.com. To unsubscribe fr

Re: Is it possible to convert ImageResource to ImageElement?

2011-02-05 Thread Jambi
Thank you for your quick response. At first I thougth it was going to work, but the Image does not appear on the canvas. I tried this (as you said): Image map = new Image(mapResources.map()); contextMap.drawImage(ImageElement.as(map.getElement()), x, y); On Feb 6, 2:47 am, Jeff Larsen wrote: >

Re: Is it possible to convert ImageResource to ImageElement?

2011-02-05 Thread Jeff Larsen
Have you tried Image img = new Image(ClientBundle.getImageResource()); ImageElement.as(img.getElement()); Haven't tested this, but it is worth a try. -- You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To post to this group, send email to

Is it possible to convert ImageResource to ImageElement?

2011-02-05 Thread Jambi
Hi there, I´m playing around with the new Canvas API in GWT 2.2. Great stuff! And I want to use a ClientBundle to get my Images for the Canvas, to use it as some kind of image preloader. But the ClientBundle is giving me ImageResource objects but I need ImageElement objects for the Canvas. This i