Saturday, February 5, 2011

Is it possible to convert ImageResource to ImageElement?

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 is the only way i figured out to add images on the canvas:

ImageElement imgMap = Document.get().createImageElement();
imgMap.setSrc("some URL");
contextMap.drawImage(imgMap, x, y);

It doesn´t seem to be possible to add normal GWT Image objects to the
canvas, or am I wrong?

But I would like to use the ImageResource from the ClientBundle. Any
ideas? Maybe I should try a different approach for an Image preloader?

cheers, Michael

--
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 from this group, send email to google-web-toolkit+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate