[Date Prev][Date Next][Index][Thread] [SGT Mail Archive] [SGT Main Page]

Creating bitmaps of SGT plots



*************************************************
Message from the sgt mail list.
*************************************************

Dear all,

I've been trying to use SGT to create graphics on the fly for a web
application.  I don't want to use a Java applet: I want to create a bitmap
picture (jpg, gif or png) on the server, then serve this to the client in a
web page.  I note that a very similar thread has been started on this
mailing list by Leonard Scardino, but there have been no replies.

I have discovered a rather clunky way of achieving this, which involves
creating the relevant SGT component (e.g. a JPlotLayout) and grabbing its
graphics using ScreenImage.createImage(JComponent com, String filename)
(http://www.discoverteenergy.com/files/ScreenImage.java).  This works, but
it has the disadvantage that the graphics are generated in an X server
off-screen, then grabbed.  This means that I need to run an X server on my
web server, which is not ideal for various local reasons.

It must be possible to draw the graphics in the graphics context of a
BufferedImage object instead of on a Swing or AWT component.  Can this be
done?  I'd be happy to hack away at the SGT code if necessary but I'd like
some pointers on where to start in the code.

Thanks in advance for any help,
Jon

-------------------------------------------------------------- 
Dr Jon Blower              Tel: +44 118 378 5213 (direct line) 
Technical Director         Tel: +44 118 378 8741 (ESSC) 
Reading e-Science Centre   Fax: +44 118 378 6413 
ESSC                       Email: jdb@mail.nerc-essc.ac.uk 
University of Reading 
3 Earley Gate 
Reading RG6 6AL, UK 
-------------------------------------------------------------- 
 



*************************************************
To remove yourself from this mailing list,
send mail to <epic-majordomo@noaa.gov> with
"unsubscribe sgt" in the message body.
==========


Privacy Notice, External Links Disclaimer.