Justforfun 0 Posted July 18, 2010 Hello, I have made a gui that is a 120x120 pixel square is there away to pixel search with in the square only so when I move it it will pixel search where I put the square instead of having locked pixel search coords. Any Idea's Share this post Link to post Share on other sites
JohnOne 1,603 Posted July 18, 2010 (edited) PixelCoordMode option << helpfile edit: Infact there is a parameter for defining which window to search in the pixelsearch function. Edited July 18, 2010 by JohnOne AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Share this post Link to post Share on other sites
Justforfun 0 Posted July 18, 2010 (edited) PixelCoordMode option << helpfileedit: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 July 18, 2010 by Justforfun Share this post Link to post Share on other sites
Theri 0 Posted July 18, 2010 Use WinGetPos to find the current location of your window and then update the coords for your pixelsearch accordingly. Share this post Link to post Share on other sites
JohnOne 1,603 Posted July 18, 2010 (edited) 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 July 18, 2010 by JohnOne AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Share this post Link to post Share on other sites
Justforfun 0 Posted July 18, 2010 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. Share this post Link to post Share on other sites
Justforfun 0 Posted July 18, 2010 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 correction0 = relative coords to the defined window1 = absolute screen coordinates (default)2 = relative coords to the client area of the defined windowAlso 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. Share this post Link to post Share on other sites
JohnOne 1,603 Posted July 18, 2010 left + width top + height AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Share this post Link to post Share on other sites
Theri 0 Posted July 18, 2010 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 Share this post Link to post Share on other sites
Justforfun 0 Posted July 18, 2010 Great guys It works thanks to both of you, I think I just had a dummy moment. Thanks again. Share this post Link to post Share on other sites