Or even simpler way - create a servlet-imageprovider.
This means following:
1. Create a servlet which works with java2d, for example. Creates
your image in java2d, makes all necessary operations, etc. If there
are any parameters of image generation, transfer them to the servlet
as query-parameters (http://myservlet?a=110&b=123&c=aaasdfWEasdfa)
2. Set output content-type of the servlet to the appropriate image
format (resp.setContentType("image/png")
3. Flush the image body (encoded to corresponding format) to the
servlet's output stream
All you need then to get image on the client-side is to issue
something like this:
image.setUrl("http://myservlet?a=112&g=assa");
Refer here for the details of the Image class:
http://google-web-toolkit.googlecode.com/svn/javadoc/1.5/com/google/gwt/user/client/ui/Image.html
And here for the servlet image-generator tutorial:
http://blog.codebeach.com/2008/02/creating-images-in-java-servlet.html
On Aug 28, 3:53 am, mars1412 <[email protected]> wrote:
> yes, but you won't be happy with the binary data in the client side :)
>
> the way to go is:
> * create the image on the server side - store it in a cache (or
> somewhere else)
> * tranfer the image path/name to the client
> * let the client crete an image with this name/path
> * and then the client-browser will issue a get request to the server
> which will return the binary data for the image
>
> On Aug 27, 6:25 pm, osquitranki <[email protected]> wrote:
>
> > Hi,
>
> > Is possible make a image in the server side and send it in a JSON call
> > by client?
>
> > Thanks!!
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---