Drawing on top of a bitmap...basics please

I want to load an image (bitmap most likely, but maybe .gif as well…no big deal one way or the other) and on top of the image be able to draw lines, circles, and text. The thing is I need to be able to move the lines, circles, and text without affecting the underlying image.

How is this done?

It would be GREAT if anyone had sample code, but I’d be really happy with just the high level aspects (use this class this way, then that one another way, etc.)

BTW, this will be done in a JSP.

Many thanks.

This is simpler than you were probably thinking:

draw the image, then draw the lines, repeat…

if you are drawing this so you can save/transmit the resulting image (sounds like it if you are using JSP) then you will be painting to a BufferedImage instead of a component. Just call getGraphics on the BufferedImage and then use it with drawImage, drawLine etc.

Look to java.sun.com for double buffering example code. It will help.

:smiley:

Thanks. I’ll do that.