Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / GUI / October 2006

Tip: Looking for answers? Try searching our database.

Read pixels that have been painted on a Canvas?

Thread view: 
Cameron Fitzhugh - 30 Oct 2006 01:22 GMT
I've been painting on a Canvas using the Graphics object returned by
getGraphics().  I would like to save an area on the Canvas and later write
it back to the Canvas.  I've been looking for some way to create a
BufferedImage using the pixels from a Graphics object, but no luck.

How do I obtain the pixels from an area on a Canvas?

Thanks,
  Cameron
Knute Johnson - 30 Oct 2006 03:27 GMT
> I've been painting on a Canvas using the Graphics object returned by
> getGraphics().  I would like to save an area on the Canvas and later write
[quoted text clipped - 5 lines]
> Thanks,
>    Cameron

Draw them on the BufferedImage first, then draw the BufferedImage onto
the Canvas.

Signature

Knute Johnson
email s/nospam/knute/

Josh Falter - 30 Oct 2006 16:34 GMT
There's always the classic java.awt.Robot createScreenCapture() or
getPixelColor()
Andrew Thompson - 30 Oct 2006 17:24 GMT
> There's always the classic java.awt.Robot createScreenCapture() or
> getPixelColor()

Your definition of 'always' does not include
sandboxed applications and applets?

Andrew T.


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.