# Using findImage()/ImgLoc With Png's

## Recommended Posts

Using findImage() With Png's

So I am trying to utilize ImgLoc and am attempting to use the findImage function to locate a single image on the screen. I am using the function as follows:

findImage("filename.png", @ScriptDir & "path\to\dir\", "FV", 1, True)

I have also tried not including the ".png" in the filename but still no luck. The photo I took is straight off the game screen and not resized so I just think I am using the function wrong when it comes to PNG's.

Any advice on using findImage with png's corrdctly is greatly appreciated.

Edited by Chilly-Chill

##### Share on other sites

they are used the same, as with xml. First parameter is an arbitrary name, used in log files, not the filename, second parameter is relative path + filename. Third option is area to search, 4 max return points and 5th is, if it should use a fresh capture or the buffer content.

##### Share on other sites

Ok when I run it like this, attempting to search entire screen,

I get an error:

Quote

findImage - Imgloc DLL Error: -1:SearchTileSource:Index was outside the bounds of the array. --    at ?????????????????????????????????????????.?????????????????????????????????????????(Object )
at ImgLoc.ImgLoc.?????????????????????????????????????????(IntPtr , String , Single , String , Int32 )

I have made sure the path is correct. My apologies if this error is a bit obscure. Let me know if you would like to see any files.

Thanks.

##### Share on other sites

"VERY IMPORTANT RULE: tile images filename MUST be named with tolerance in format “tilename_level_[Fill]_tolerance” where tolerance is a 2 digit number. Ex: My-NameTile_7_92.bpm will return a 92 (0.92) value for tolerance and 7 for level,  [fill] is not mandatory. DO NOT USE THE “_” ANYWHERE ELSE IN FILENAME (YOU HAVE BEEN WARNED!"

##### Share on other sites

Thanks for the that link I appreciate it.

##### Share on other sites
On 17/4/2019 at 10:52, Chilly-Chill dijo:

Thanks for the that link I appreciate it.

Use QuickMis();

Maybe you find it easier.

Edited by Boldina

##### Share on other sites
On 17/4/2019 at 1:59, TripleM dijo:

they are used the same, as with xml. First parameter is an arbitrary name, used in log files, not the filename, second parameter is relative path + filename. Third option is area to search, 4 max return points and 5th is, if it should use a fresh capture or the buffer content.

Triple M, help us, since we look for images with transparency, does this work?

findMultiple does not work with transparency.

Please do something that when it detects the alpha channel at 0 it jumps, as if it were green.

Edited by Boldina

## Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

×   Pasted as rich text.   Paste as plain text instead

Only 75 emoji are allowed.