Ryan Suther wrote:
>
> Sorry if this is too far off topic, but... :-)
>
> Is anyone out there familiar with editing images on the fly? I currently
> have the servlet loading an image from a url and then sending it to the
> browser as image/jpeg. I would like to be able to add text to the image
> before sending the image to the browser.
>
> I'm using the GLF library from Sun to do all of the encoding etc... like I
> said, the image makes it to the browser, but the text isn't there...
>
> the code in question...
...
> FontRenderContext frc = g.getFontRenderContext();
> Font defaultfont = new Font("Arial", Font.PLAIN, 14);
> g.setColor(Color.red);
> TextLayout tl = new TextLayout(message, defaultfont, frc);
> tl.draw(g, x1, y1);
I do it with just :
Font muj= new Font("Times New Roman",Font.PLAIN,15);
g.setFont(muj);
g.drawString("ABCDEFGHI",20,20);
and it works ...
--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
INET, a.s. Mgr. Martin Kuba
Kralovopolska 139 e-mail: [EMAIL PROTECTED]
601 12 Brno WWW: http://www.inet.cz/~makub/
Czech Republic tel: +420-5-41242414/32
--------------------------------------------------------------------
PGP fingerprint = D8 57 47 E5 36 D2 C1 A1 C3 48 B2 59 00 58 42 27
http://wwwkeys.cz.pgp.net:11371/pks/lookup?op=index&search=makub
--------------------------------------------------------------------
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html