Spawnova / ShinsImageScanClass

A library/class for fast AutoHotKey image/pixel searching
MIT License
74 stars 12 forks source link

PixelPosition only primary monitor? #33

Open x2nbit opened 1 day ago

x2nbit commented 1 day ago

include ShinsImageScanClass.ahk

scan := ShinsImageScanClass() if scan.PixelPosition(refColor,x,y,0) { MsgBox "True" }

In a multi-monitor environment, it gets the color when the x,y coordinates are on the primary monitor, and doesn't work correctly when the x,y coordinates are on another monitor. Is there any way to make it work on all monitors?

Spawnova commented 18 hours ago

The second param when instantiating the class is used to specify whether or not to use the virtual desktop (which includes all monitors) or just the main monitor, try this

#include ShinsImageScanClass.ahk
scan := new ShinsImageScanClass(0,0) ;0=desktop, 0=virtualdesktop

color := 0xFFFF0000
x := 2400
y := 500

if (scan.PixelPosition(color , x, y)) {
MsgBox % "Pixel found!"
}
x2nbit commented 6 hours ago

oh,It's working. Thank you so much for a great library!