Skip to content

emp0ry/locateImageOnScreen

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Locate Image On Screen

Locate an image on the all screens and return its position using OpenCV

Example of use

#include "locateImageOnScreen.h"
#include <thread>
#include <chrono>

int 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;
}

About

Locate an image on the all screens and return its position using OpenCV

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages