You can make a servlet and point the url (with or without parameters)
of the image to that servlet,
in the doPost or doGet method:
final BufferedImage image = new BufferedImage(canvasWidth,
canvasHeight, BufferedImage.TYPE_INT_RGB);
final Graphics2D graphics2D = image.createGraphics();
// create the image... (you can use parameters from the url).
...
//at the end :
response.setContentType("image/jpg");
final ByteArrayOutputStream baos = new ByteArrayOutputStream();
ImageIO.write(image, "jpg", baos);
final OutputStream out = response.getOutputStream();
baos.writeTo(out);
baos.flush();
out.close();
greets,
Erik
On Oct 22, 10:37 am, "alex.d" <[email protected]> wrote:
> Glad i could help ;)
>
> On 22 Okt., 10:26, "Robert J. Carr" <[email protected]> wrote:
>
> > I appreciate your imagination. :)
>
> > On Thu, Oct 22, 2009 at 1:22 AM, alex.d <[email protected]>
> > wrote:
>
> > > There was another really insane way where you actually decode your
> > > image (bytes you've sended back) and produce a lot of 1px sized divs
> > > with accordant colors which makes the image :)) But like i said -
> > > it's kind of crazy.
>
> > > On 22 Okt., 07:55, "Robert J. Carr" <[email protected]> wrote:
> > >> Thanks Ian ... I had a feeling it was going to be complicated, I just
> > >> wanted to make sure I wasn't missing something.
>
> > >> Looks like I'm relegated to building complex queries or making two
> > >> requests. Thanks again for the time!
>
> > >> On Wed, Oct 21, 2009 at 9:12 PM, Ian Petersen <[email protected]> wrote:
>
> > >> > You can send bytes back to the client as an RPC response (it's just an
> > >> > HTTP request, after all) but the problem is what to do with the bytes
> > >> > once you have them. If you're willing to restrict yourself to
> > >> > browsers that support data:// URLs, you can send the image back as a
> > >> > data:// URL and just drop the result into an img tag. That approach
> > >> > excludes many (all?) versions of IE. As far as I know, the only IE
> > >> > that _might_ support data:// URLs is IE8. To be fully-compatible, you
> > >> > need to forge ahead with your existing approach or, as you say,
> > >> > generate a URL via RPC and make the generated URL resolve to the
> > >> > desired image.
>
> > >> > If you want to fool around with the RPC infrastructure, you could
> > >> > possibly use a GWT-RPC request payload as the query parameter in a
> > >> > standard request, if you think such a representation would be more
> > >> > compact/useful than the representation you're currently using. On the
> > >> > server side, you could then use the RPC class (is that still in use?)
> > >> > to deserialize the parameters and drive the image request. Might be
> > >> > more trouble than it's worth, though.
>
> > >> > Ian
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---