wood burning stoves
The moose likes Swing / AWT / SWT and the fly likes Can not get individual pixel values Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Can not get individual pixel values" Watch "Can not get individual pixel values" New topic

Can not get individual pixel values

Mahesh Chavan

Joined: Jun 17, 2012
Posts: 1
I want to know individual alpha red blue and green values of a pixel. Following code displays image from a file ( given as first argument ) but does not show any rgba vaures ( all values returned are 0 )
Pl. let me know what is the error in the code :

I have also tried to get rgba values in a array int rgba[] form. But I am always getting zero values for all pixels.
Please help.
Darryl Burke

Joined: May 03, 2008
Posts: 5115

Hello Mahesh, and welcome to the Ranch! Please BeForthrightWhenCrossPostingToOtherSites


Also, the code you copied and added to has been around for more than 12 years*. I suggest you go through the Swing trail of the Oracle tutorials, where you will find updated sample code that (a) respects Swing's single threaded rule and (b) doesn't use methods that have been deprecated since that coed was written.

* http://www.jguru.com/faq/view.jsp?EID=53328

luck, db
There are no new questions, but there may be new answers.
I agree. Here's the link: http://aspose.com/file-tools
subject: Can not get individual pixel values
It's not a secret anymore!