Results 1 to 2 of 2
- 04-02-2012, 07:37 PM #1
Member
- Join Date
- Apr 2012
- Posts
- 1
- Rep Power
- 0
- 04-02-2012, 09:06 PM #2
Re: knowing color of a pixel in a window
I'm not sure if this is what you are looking for, but for any object that extends Component, you can call getColorModel(), which returns the instance of ColorModel used to display the component.
With the ColorModel, you can then call getRGB(int pixel), passing in the pixel you are interested in, and it will return the color components of the pixel in the default RGB color model format.
For example:
Java Code:myJFrame.getColorModel().getRGB(400);
Last edited by sehudson; 04-02-2012 at 09:09 PM.
Similar Threads
-
scanning an image for a certain pixel color
By lostsoul28 in forum New To JavaReplies: 1Last Post: 02-01-2012, 01:50 PM -
[HELP] How to locate a pixel in an image by color?
By santafan in forum Java 2DReplies: 4Last Post: 11-08-2011, 05:04 AM -
BufferImage Screen to search for pixel by Color?
By santafan in forum Java 2DReplies: 1Last Post: 11-08-2011, 05:04 AM -
Find Pixel With RGB Color?
By TyCox94 in forum JDBCReplies: 8Last Post: 09-23-2011, 04:20 AM -
can you ask the color of one pixel?
By liluma in forum New To JavaReplies: 7Last Post: 09-06-2011, 07:53 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks