Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within Swing / AWT / SWT
Search Coderanch
Advance search
Google search
Register / Login
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
Pie Elite
all forums
this forum made possible by our volunteer staff, including ...
Marshals:
Campbell Ritchie
Jeanne Boyarsky
Ron McLeod
Paul Clapham
Liutauras Vilda
Sheriffs:
paul wheaton
Rob Spoor
Devaka Cooray
Saloon Keepers:
Stephan van Hulst
Tim Holloway
Carey Brown
Frits Walraven
Tim Moores
Bartenders:
Mikalai Zaikin
Forum:
Swing / AWT / SWT
paint()
Randall Twede
Ranch Hand
Posts: 4716
9
I like...
posted 11 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
i have a method in my program that disturbs me a little. it is a method in a class that extends JPanel.
public BufferedImage createImage() { Dimension d = getSize(); Rectangle region = new Rectangle(0, 0, d.width, d.height); BufferedImage temp = new BufferedImage(region.width, region.height, BufferedImage.TYPE_INT_RGB); Graphics2D g2d = temp.createGraphics(); paint( g2d ); g2d.dispose(); return temp; }
it works just fine but it calls paint() directly
SCJP
Visit my
download page
Darryl Burke
Bartender
Posts: 5167
11
I like...
posted 11 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Nothing disturbing about painting a Component to a BufferedImage.
luck, db
There are no new questions, but there may be new answers.
Did you see how Paul
cut 87% off of his electric heat bill with 82 watts of micro heaters
?
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
How to store what the JPanel draw
Printing Question
Setting java.awt.Image background color
Convert between AWT Image and byte array
compile error
More...