question fo class_dd imagesearch (double monitor)

Get help with using AutoHotkey and its commands and hotkeys
Tear
Posts: 22
Joined: 22 Jul 2018, 09:46

question fo class_dd imagesearch (double monitor)

17 Mar 2019, 00:54

hello guys i have some question.

when i use one monitor , the program works well.

but , if i use double monitor it doesn't work. why this situation happening?? ...

some solution plz....!!

this is my code.

ImageSearch,vx,vy,0,0,a_ScreenWidth,a_Screenheight, *transblack *7 hello.bmp
if errorlevel = 0
{
sleep 100
dd.mousemove("P",vx,vy)

sleep 100
dd._btn("LButtonDown")
sleep 2000
dd._btn("LButtonUp")
sleep 100
}
swagfag
Posts: 2379
Joined: 11 Jan 2017, 17:59

Re: question fo class_dd imagesearch (double monitor)

17 Mar 2019, 04:33

go over every instruction in ur code and check whether it can fail in some way

ImageSearch
  • is the image being loaded
  • are the search coordinates being supplied correct
  • can it find the image
  • does it output coordinates that make sense
  • CoordMode?
_dd stuff
  • are u giving it the right coordinates
  • does it even support the coordinates ure supplying
etc etc
User avatar
Scr1pter
Posts: 1066
Joined: 06 Aug 2017, 08:21
Location: Germany

Re: question fo class_dd imagesearch (double monitor)

17 Mar 2019, 14:02

Maybe you must change this line:
ImageSearch,vx,vy,0,0,a_ScreenWidth,a_Screenheight, *transblack *7 hello.bmp
to
ImageSearch,vx,vy,-1920,0,a_ScreenWidth,a_Screenheight, *transblack *7 hello.bmp
(For example)

If you use more than 1 display, it can be needed to work with negative pixel coordinates.
In such a case:
Main display -> Secondary display
I think 0, 0 is the smallest possible.
But for this case:
Secondary display -> Main display
0, 0 is the start point of the main display.
If the secondary display's resolution is 1920x1080,
-1920, 0 will be the smallest possible coordinate.

Cheers!
.Please use code tags when posting code!
Image
Keyboard: Logitech G15 FE - Mice: Logitech G9 FE, G502 FE, G602 - OS: Windows 10 Pro 64 Bit - AHK version: 1.1.29.00

Return to “Ask For Help”

Who is online

Users browsing this forum: Bing [Bot], Gibbons, Google [Bot], letacio, unconnu and 42 guests