简体   繁体   中英

How do I draw squares on top of applications, get coordinates/size of the squares, and check to see if the image beneath the squares has changed?

I want to create a windows app. I want the user to be able to click a button on the app. Once the button is clicked I want the user to draw a square somewhere on the screen... anywhere. The square will probably be drawn over another application window, so that window needs to ignore any clicking that is happening over it. Once the square has been drawn I want to grab the coordinates of where it was drawn and the size of it. Then i want to continuously check to see if the image being displayed behind this virtual square changes. If it changes I want to force a mouse click in the center of it. I think I can do the mouse click with mouse_event() in user32.dll.

However, I have not a freaking clue how to do the rest =D

Any direction would be awesome...

All I am looking for here are links to libraries and/or API's. I do not know where to start looking and I am fully capable of reading documentation.

Using Java, Zoom uses createScreenCapture() to render an enlarged 16 x 16 pixel BufferedImage taken as the mouse is dragged across the screen. Once you have the BufferedImage , you can periodically recapture the screen at the same point and use the getRGB() method to compare. See also Using Timers in Swing Applications .

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