tobius Posted October 4, 2022 Share Posted October 4, 2022 (edited) Hi, thanks for sharing the script. Unfortunately i can not get it running. I would like to find a bmp within another bmp with minimal length of code, can anybody please help me? I played around with the code on page 1 and would like to post my attempts but i am honestly not sure which attempts made sense anyway. I tried to to comment/uncomment but i guess, this was related to other scope (with catching active windows, where i gotsome error with regions). Can anyboday please help me, how to find bmp in bmp? I know, in the following code there are a lot of things missing, but i am already lost to know, which parts are relevant or not, sorry for that Local $Find_this_image = @ScriptDir & '\folder_symbol.bmp' Local $within_this_image = @ScriptDir & '\desktop.bmp' Local $aResult = findBMP($within_this_image, $Find_this_image, $c24RGBPartialMatch) _ArrayDisplay($aResult) Many thanks for help and understanding tobius Edited October 4, 2022 by tobius Link to comment Share on other sites More sharing options...
junkew Posted October 7, 2022 Author Share Posted October 7, 2022 "Unfortunately I cannot get it running" is very vague, is it compiling without errors? 1. run the first example and post the output/results 2. experiment with your examples, it seems you want to find something on the desktop 3. post your bmp files The way you save bmp files to disk can already make a huge difference in finding. The slightest mismatch on a pixel will give no result. Describe what your expectations are and make sure you look in FAQ for other solutions FAQ 31 How to click some elements, FAQ 40 Test automation with AutoIt, Multithreading CLR .NET Powershell CMDLets Link to comment Share on other sites More sharing options...
tobius Posted October 8, 2022 Share Posted October 8, 2022 Thanks for your feedback and effort. I am doing it now by opening / displaying the picture and using imagesearch as there i also have shade tolerance. Link to comment Share on other sites More sharing options...
prometheus72 Posted February 20, 2023 Share Posted February 20, 2023 I was search for ages for something like this. Though I implemented it in Powershell .Net. I was having trouble with small images. Until I went through and checked the formula for find the x and y coordinates. Quote $foundAtTop = int($iPos / $BMP1lineWidth) -$i $foundAtLeft = int(mod($iPos,$bmp1linewidth) / $imgBytes) If you rewrite it like this: Quote $foundAtLeft = int(mod($iPos,$bmp1linewidth) / $imgBytes) $foundAtTop = int(($iPos - ($foundAtLeft * $imgBytes)) / $bmp1linewidth) You will get the exact coordinates, without any rounding issues. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now