The Artima Developer Community
Sponsored Link

Java Answers Forum
Hot to get RGB of a pixel at mousX and MouseY

1 reply on 1 page. Most recent reply: May 26, 2005 6:25 AM by barron

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 1 reply on 1 page
Sanjay Perera

Posts: 42
Nickname: angel6
Registered: Apr, 2004

Hot to get RGB of a pixel at mousX and MouseY Posted: May 25, 2005 5:11 AM
Reply to this message Reply
Advertisement
Hello, Can anyone tell me how to get the pixel's RGB value (Pixel which is at mouse X and Y)?

Do I have to use Robot class? Anyother way? Also how to get the pixel's RGB value -->(pixel value given on a Component)<--

Thanks!!


barron

Posts: 13
Nickname: toniblair
Registered: May, 2005

Re: Hot to get RGB of a pixel at mousX and MouseY Posted: May 26, 2005 6:25 AM
Reply to this message Reply
The only way I know is to use Robot.getPixelColor(x,y,)
and then:
returnedColor.getRGBComponents();
that'll return you a RGBA array. or use returnedColor.getRed(); .getBlue() and .getGreen();

Why do you not want to use the Robot class??

Flat View: This topic has 1 reply on 1 page
Topic: JDBC and applets Previous Topic   Next Topic Topic: HELP - converting characters

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use