Win a copy of Learning OpenStack Networking: Build a solid foundation in virtual networking technologies for OpenStack-based clouds this week in the Cloud/Virtualization forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Ganesh Patekar
  • Stephan van Hulst
  • Pete Letkeman
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Ron McLeod
  • Vijitha Kumara

Copying panel contents to an image.  RSS feed

 
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???
 
Bartender
Posts: 9521
12
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 ]
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!