|
-
March 1st, 2000, 04:15 PM
#1
Capturing and Redrawing an Image
Hi,
I'm building a small drawing application in Swing. I'm using JComponent as the drawing board,
I capture the drawing on the JComponent using the following code:
RepaintManager manager = RepaintManager.currentManager(drawBoard);
drawing = manager.getOffscreenBuffer(drawBoard, drawBoard.getWidth(), drawBoard.getHeight());
and I use the following code for redrawing the image on the JComponent
getGraphics().drawImage(drawing,0,0,drawBoard.getWidth(), drawBoard.getHeight(),drawBoard);
What happens when redrawing is that I get other parts on the GUI redrawn on the drawing board!
Any one can tell me what am I doing wrong? should I try something else?
Thanks in advance,
Ayman
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|