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

RE: Creating an animation with BuffferedImages



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

Are you trying to create Bufferedimage from your screen shots? If that is the case you can use something like the following:
BufferedImage img = new BufferedImage(rpl_.getWidth(),rpl_.getHeight(),BufferedImage.TYPE_INT_RGB);
        Graphics2D dd = (Graphics2D) img.getGraphics();
        dd.setBackground(Color.white);
        dd.fillRect(0,0,rpl_.getWidth(),rpl_.getHeight());
        rpl_.draw(dd);
        dd.translate(0,rpl_.getHeight());
        rpl_.getKeyPane().draw(dd);
        dd.dispose();

where rpl_ is sgt.swing.JPlotLayout object.
Hope this helps
nihat 

-----Original Message-----
From: owner-sgt@noaa.gov [mailto:owner-sgt@noaa.gov] On Behalf Of Matthias Trümmel
Sent: Sunday, January 13, 2008 1:50 PM
To: sgt@noaa.gov
Subject: Creating an animation with BuffferedImages

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

Hi,

I'm currently working with SGT for a school-project.

My current target is to create an animation out of the given data.
Because of the great amount of data I want to preload the frames to
BufferdImages (or something similar) to enhance the performance.

To do so I call the paint(Graphics g) method with the Graphics-object from
the BufferedImage.
But when I want to show the BufferedImage on the screen the screen remains
empty.

Are there any methods I have to call first in order to get the data drawn?

Thanks in advice,
Matthias


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


*************************************************
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.