File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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
Author

Can not get individual pixel values

Mahesh Chavan
Greenhorn

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
Bartender

Joined: May 03, 2008
Posts: 4664
    
    5

Hello Mahesh, and welcome to the Ranch! Please BeForthrightWhenCrossPostingToOtherSites
https://forums.oracle.com/forums/thread.jspa?threadID=2403002

edit:
http://www.java-forums.org/awt-swing/60745-how-get-individual-pixel-colors.html
http://www.javaprogrammingforums.com/awt-java-swing/16193-can-not-get-individual-pixel-values-using-getrgb.html#post68931

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