简体   繁体   中英

How to find color of a certain pixel in a JFrame?

I need to find the color of a certain pixel WITHIN my JFrame. Unfortunately, I want the frame to be movable, so I can't use the Robot method createScreenCapture.

You use the JFrame.getLocationOnScreen() method to get the frames location.

Then you use the Robot.getPixelColor(...) method to get the pixel relative to the frames location.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM