Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

To get the color or pixels when the cursor move

 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 8521
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic