Jump to content
BatMan22

Image Search Library? My only remaining option?

Recommended Posts

BatMan22

Anyone happen to have imagesearch library to upload? The link on the forums seems dead? Or am I looking at the wrong spot (see below)? For the record, not for gaming, just tired of trying to make MS UIU work, even once I solved everything and got it to click where I wanted... the program is old and buggy so it crashes 20-30% of the time and it drives me crazy (not MS UIU fault) :( . So I think the only option I have left is image search right?I know it's the worst way to go about solving the issue but the using click coordinates changes between PC's with different screen resolutions even with windowed mode. 

 

 

Share this post


Link to post
Share on other sites
Xandy
Posted (edited)

Video is long at 4 minutes, but it shows setting up an Image and dynamically detecting on screen.  The image detected is the Notepad.exe icon at Left / Top of Notepad window.

If $win_title <> '' Then
                        ; Use Window Title
                        If $cursor = 1 Then ;one of these guys (might still) leak memory when returning the cursor data

                            $hscreen = _ScreenCapture_CaptureWnd("", WinGetHandle($win_title), $area_x, $area_y, $area_x + $area_w, $area_y + $area_h, $cursor) ;I won't leak the cursor
                            ;out($win_title &": Show Cursor SCREENSHOT AREA: " & $area_x & " " & $area_y & " " & $area_x + $area_w & " " & $area_y + $area_h)

                        Else

                            $hscreen = _ScreenCapture_CaptureWndV2("", WinGetHandle($win_title), $area_x, $area_y, $area_x + $area_w, $area_y + $area_h, $cursor);, $iBitBltFlag)
                            ;out($win_title &": Hide Cursor SCREENSHOT AREA: " & $area_x & " " & $area_y & " " & $area_x + $area_w & " " & $area_y + $area_h)
                            ;$hscreen = _ScreenCapture_CaptureWndV2("screenshot.bmp", WinGetHandle($win_title), $area_x, $area_y, $area_x + $area_w, $area_y + $area_h, $cursor);, $iBitBltFlag)

                        EndIf

                    Else
                        ; Save Screenshot to Compare with Rect
                        ; These are seporated to figure if one still leaks the cursor
                        If $cursor = 1 Then ;one of these guys leaks memory when returning the cursor data
                            $hscreen = _ScreenCapture_Capture("", $area_x, $area_y, $area_x + $area_w, $area_y + $area_h, $cursor) ;I won't leak the cursor
                        Else
                            $hscreen = _ScreenCapture_CaptureV2("", $area_x, $area_y, $area_x + $area_w, $area_y + $area_h, $cursor, $iBitBltFlag) ;I help you get pixel data from layered windows
                        EndIf

                    EndIf ; win_title <> ''
Edited by Xandy

Share this post


Link to post
Share on other sites
Xandy
Posted (edited)

Snippet of required functions.  Above.

Double post b/c couldn't get editor to do what I wanted with text and Images.

Edited by Xandy

Share this post


Link to post
Share on other sites
BatMan22

@Xandy Hmm.. I would really prefer to use an internal imagesearch library.. not an external program that my program calls or is called by. Cool video, I want to do basically exactly that. I just plan to do with with the imagesearch library on the forums, but the link is broken. 

Share this post


Link to post
Share on other sites
Xandy
Posted (edited)

I showed you the code.  What else do you need?  The only library I know how to use, is the one I illustrated .

Edited by Xandy

Share this post


Link to post
Share on other sites
BatMan22
Posted (edited)

@Xandy Wait what? I don't see a search function in your script? Your script just captures the  screen right? Also I need the actual library files.. that's why I posted... aka.. the link that I linked to ImageSearchLibrary is dead.

Edited by BatMan22

Share this post


Link to post
Share on other sites
Xandy

Okay.  I iterate through pixels and compare with _GDIPlus_BitmapGetPixel.

You might not need _ScreenCapture_CaptureV2.  _ScreenCapture_CaptureWnd() comes with AutoIt I think.

Share this post


Link to post
Share on other sites
BatMan22

@Xandy, thanks dude. If I can't find the imagesearch library somewhere then I will have to do that. I appreciate your help. 

Share this post


Link to post
Share on other sites
BatMan22
Posted (edited)

Found it!

Edited by BatMan22

Share this post


Link to post
Share on other sites
BatMan22

@Miliardsto hooked me up with the files he used here and the github for that is: 

https://github.com/ellysh/ImageSearch

But I haven't had time to test that yet.. but what worked for me was the attached zip file, I butchered the Example File so if you should know that other available functions are listed in the _ImageSearch.au3 file, four total (_IMGSearch_Area, _IMGSearch, _IMGSearch_Wait, _IMGSearch_WaitArea)

image files.zip

  • Like 1

Share this post


Link to post
Share on other sites
Miliardsto

your example works for me . no error . try to downgroad autoit version

Share this post


Link to post
Share on other sites
BatMan22
On 3/10/2018 at 11:31 AM, Miliardsto said:

your example works for me . no error . try to downgroad autoit version

I think you misunderstood, I posted it because it worked. :)

Share this post


Link to post
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

×