Animation: BufferedImage and Graphics2D

Hello all,

I am new to Java animation.

Now I want to write an animation showing the tracks of some points. The position of the points are allocated according to some blocks of data in somewhat time interval, for instance, every 2 seconds.

So I want to draw out the position of points for each interval, one drawing for one internal, and regard the drawings as objects of Image, alternatively as objects of BufferedImage. So that I can use them as images in sequence and then show them as animation later.

In my mind, i should create an object bImg of BufferedImage. and then an object grph of Graphics2D,

BufferedImage bImg = new BufferedImage(10, 10, 1);

Graphics2D grph = bImg.createGraphics();

Then drawing using grph.

Now the Question: I dont know clearly what is the relationship HERE between BufferedImage and the Graphics2D, alternatively bImg and grph.

Thanx in advance!

cluoyan

[963 byte] By [cluoyan] at [2007-9-26 13:53:54]
# 1
The BufferedImage is your piece of paper. The Graphics2D is your pen. Does that help?Michael Bishop
mbishop78 at 2007-7-2 14:54:43 > top of Java-index,Desktop,Core GUI APIs...
# 2
Hi mbishop78 ,It is helpful! Thanx!cluoyan
cluoyan at 2007-7-2 14:54:43 > top of Java-index,Desktop,Core GUI APIs...