File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

To get the color or pixels when the cursor move

 
Anonymous
Ranch Hand
Posts: 18944
  • 0
  • 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
  • 0
  • 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.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic