https://github.com/emp0ry/locateimageonscreen
Locate an image on the screen and return its position
https://github.com/emp0ry/locateimageonscreen
Last synced: 3 months ago
JSON representation
Locate an image on the screen and return its position
- Host: GitHub
- URL: https://github.com/emp0ry/locateimageonscreen
- Owner: emp0ry
- License: mit
- Created: 2025-02-16T16:33:29.000Z (4 months ago)
- Default Branch: main
- Last Pushed: 2025-02-16T16:52:40.000Z (4 months ago)
- Last Synced: 2025-02-16T17:36:26.706Z (4 months ago)
- Language: C++
- Size: 6.84 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Locate Image On Screen
Locate an image on the all screens and return its position using [OpenCV](https://github.com/opencv/opencv)## Example of use
```cpp
#include "locateImageOnScreen.h"
#include
#includeint main() {
while (true) {
POINT pos;
if (locateImageOnScreen("image.png", pos, true, 0.8)) {
SetCursorPos(pos.x, pos.y);
mouse_event(MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0);
mouse_event(MOUSEEVENTF_LEFTUP, 0, 0, 0, 0);
}
std::this_thread::sleep_for(std::chrono::milliseconds(1000));
}return 0;
}
```