• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Copying panel contents to an image.

 
Archer DaPunk
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm trying to copy panel contents to an image I'm using the following code and the string "blah" gets drawen on the image. When I try and paint the image back onto the panel it paints an image with the same color as the panel background and also the text "blah"
The thing is I drawlines onto the panels graphics in another procedure but it doesn't seem to copy those lines to the image.
Anyone know why???
 
Joe Ess
Bartender
Posts: 9312
10
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Archer DaPunk:

The thing is I drawlines onto the panels graphics in another procedure but it doesn't seem to copy those lines to the image.

What is this other procedure and when is it called?



What are you invoking drawLine() on? I think you may be writing your lines directly on the panel, then overwriting them with the g2.drawImage() call.
 
Archer DaPunk
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is how I call the .drawline()
I send drawLine the Graphics i want to draw onto ie. tPanel.getGraphics()
I don't fully understand what all the sin and cos maths are for but it works. I got this code from my sample API for smartboards (electronic whiteboards)
I want to be able to copy these lines that i draw into an image so i can redraw it back onto the panel with an alpha channel and then still be able to draw on the panel with the smartboard.

[ October 13, 2003: Message edited by: Archer DaPunk ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic