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 / General / August 2007

Tip: Looking for answers? Try searching our database.

PixelGrabber question

Thread view: 
buu - 19 Aug 2007 17:40 GMT
I'm trying to access a pixels from a part of an image, but it seems not
working.
How could I access a pixels from only a part of an image?
Knute Johnson - 19 Aug 2007 17:46 GMT
> I'm trying to access a pixels from a part of an image, but it seems not
> working.
> How could I access a pixels from only a part of an image?

Use a BufferedImage and use one of the getRGB() methods of that class.

Signature

Knute Johnson
email s/nospam/knute/

Thomas Fritsch - 19 Aug 2007 17:58 GMT
> I'm trying to access a pixels from a part of an image, but it seems not
> working.
It should work. I suspect there is a bug somewhere in your code. But
without seeing your code it impossible to know exactly where.
> How could I access a pixels from only a part of an image?

Signature

Thomas

buu - 19 Aug 2007 19:31 GMT
I don't have big code (just a few lines).

But, if I have a photo 100x200 pixels, and I would like to read just first
40x50 pixels, what should be syntax for PixelGrabber?

>> I'm trying to access a pixels from a part of an image, but it seems not
>> working.
> It should work. I suspect there is a bug somewhere in your code. But
> without seeing your code it impossible to know exactly where.
>> How could I access a pixels from only a part of an image?
Thomas Fritsch - 19 Aug 2007 20:03 GMT
> I don't have big code (just a few lines).
Where? I don't see anything.

> But, if I have a photo 100x200 pixels, and I would like to read just first
> 40x50 pixels, what should be syntax for PixelGrabber?
Carefully read the API docs at
<http://java.sun.com/j2se/1.4.2/docs/api/java/awt/image/PixelGrabber.html>
There is an example how to get all the pixels of an image. You have to
modify it for getting only the top-left 40x50 pixels of the image.

Signature

Thomas



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.