You can't, at least not directly. GWT does only what HTML does, and in HTML images are loaded via the SRC attribute in an IMG element. You can write basic doGet/doPost servlet that returns and image and put use its URL in com.google.gwt.user.client.ui.Image.setUrl() (which sets the SRC attribute).
If you feel you must use an RPC call for the image, have the RPC call return a java.lang.String of the image (GIF, JPEG, or PNG) in Base 64. In the onSuccess() method, use that result String as the argument for setUrl(). On Sep 7, 9:25 am, Magnus <[email protected]> wrote: > Hi, > > I tried to pass an Image object via RPC, but it doesn't work: > > com.google.gwt.user.client.ui.Image is not assignable to > 'com.google.gwt.user.client.rpc.IsSerializable' or > 'java.io.Serializable' nor does it have a custom field serializer > (reached via com.google.gwt.user.client.ui.Image > > How can I do that? > > Magnus -- You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
