This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Swing / AWT / SWT and the fly likes To get the color or pixels when the cursor move Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "To get the color or pixels when the cursor move" Watch "To get the color or pixels when the cursor move" New topic
Author

To get the color or pixels when the cursor move

Anonymous
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
hi,
I want to get the RBG or pixel color, when I move my cursor over the Image in Swing. Whether there is any class in java.awt.image which gives the color. if u have done, pls reply with the code.thanks
Cindy Glass
"The Hood"
Sheriff

Joined: Sep 29, 2000
Posts: 8521
The Color class has several methods that you can use. Or in the Image Package you can use ColorModel. It has
getBlue()
getGreen()
getRed()
etc.


"JavaRanch, where the deer and the Certified play" - David O'Meara
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: To get the color or pixels when the cursor move
 
Similar Threads
Java Swing Custom Cursor ( Mac styled rotating dots busy cursor)
Input Textfield Background Color When the Cursor Is There
Picking the color under the mouse cursor on a JPanel
Rules roundup does not load
Movable JPanel - How?