Jump to content

Pixel Search


Recommended Posts

PixelCoordMode option << helpfile

edit:

Infact there is a parameter for defining which window to search in the pixelsearch function.

Ok I will look again mabye I missed it on the coord mode Opt("PixelCoordMode", 3) would be for the client window yes?

I seen where it says you can select window handle to search but not sure exactly how to set left top right bottom coords for the window if I am going to be moving it.

Edited by Justforfun
Link to comment
Share on other sites

I think Opt("PixelCoordMode", 2) for the clent area of the window, and you also have to define that window in the pixelsearch function.

Your top left coords will always be 0,0 .

Edited by JohnOne

AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Link to comment
Share on other sites

Use WinGetPos to find the current location of your window and then update the coords for your pixelsearch accordingly.

PixelSearch ask for PixelSearch( Left, Top, Right, Bottom, Color, Shade, Step, Handle)

Where WinGetPos(Handle, Text) Returns X, Y, Width, and Height, so how would I enter left top right bottom with only Knowing left and top from wingetpos.

Link to comment
Share on other sites

I think Opt("PixelCoordMode", 2) for the clent area of the window, and you also have to define that window in the pixelsearch function.

Your top left coords will always be 0,0 .

Its not 3 I think I said 3 I ment 2 thanks for the correction

0 = relative coords to the defined window

1 = absolute screen coordinates (default)

2 = relative coords to the client area of the defined window

Also If I set my sqaure top left to screens 0,0 then I can get the right and bottom for pixel search this is the part I am not understanding is how to set the right and bottom for my gui window is that correct.

Link to comment
Share on other sites

X and Y from WinGetPos are the top left coords for the window. Width and Height are the pixel width and height of the window.

While 1
    $pos = WinGetPos($mywindow)
    If @error Then
        MsgBox(0,"Error","Window not found.")
    EndIf
    $coords = PixelSearch($pos[0],$pos[1],($pos[0]+$pos[2]),($pos[1]+$pos[3]),$hex,$variation)
    If Not @error Then
        ;Found.
    ElseIf @error Then
        ;Not found.
    EndIf
WEnd
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...