-
Posts
26 -
Joined
-
Last visited
lamnhan066's Achievements

Seeker (1/7)
7
Reputation
-
Hi @tobius, Those are the right parameters in your case, but I think that function has issues because its body doesn't use those parameters (I'm not sure about this because it is quite a long time but I still have a quick rewrite of the function at the end of this post). This parameter is also known as color in bounds or color variation of each pixel, it has a value between 0 and 255 (usually between 15 and 30 is used). When the value is 0, it means that all pixel colors must be the same between the finding image and the result image. This is the max number of results. It will increase the performance if you know the max number of results that you need. Here is a quick rewrite of that function (without testing). Please try it and let me know the result: Func _BmpImgSearch($SourceBmp, $FindBmp, $x = 0, $y = 0, $iWidth = -1, $iHeight = -1, $Tolerance = 15, $Transparency = "", $MaxImg = 1000) Local $SourceBitmap = _GDIPlus_BitmapCreateFromFile($SourceBmp) If @error Then Return SetError(1, 0, 0) Local $Right = $iWidth + $x If $iWidth = -1 Or $iWidth = Default Then $Right = _GDIPlus_ImageGetWidth($SourceBitmap) + $x Local $Bottom = $iHeight + $y If $iHeight = -1 Or $iHeight = Default Then $Bottom = _GDIPlus_ImageGetHeight($SourceBitmap) + $y Local $pos = __ImgSearch($x, $y, $Right, $Bottom, $FindBmp, $SourceBitmap, $Tolerance, $Transparency, $MaxImg) Return SetError(@error, 0, $pos) EndFunc ;==>_BmpImgSearch
- 45 replies
-
- handleimgsearch
- image search
-
(and 1 more)
Tagged with:
-
Hi @tobius, I wrote these UDF function headers in Vietnamese, so I think your computer shows weird letters because it doesn't support Vietnamese. I will translate it into English when I have time. And yes, you are using the right function and you don't have to fill in all the parameters if you don't need to. For instance: #include <Array.au3> #include "HandleImgSearch.au3" Local $Find_this_image = @ScriptDir & '\folder_symbol.bmp' Local $In_this_image = @ScriptDir & '\desktop.bmp' Local $aResult = _BmpImgSearch($In_this_image, $Find_this_image) _ArrayDisplay($aResult) Since AutoIt doesn't support named parameters, if you want to modify $Tolerance you can fill default values in all parameters before it like below: #include <Array.au3> #include "HandleImgSearch.au3" Local $Find_this_image = @ScriptDir & '\folder_symbol.bmp' Local $In_this_image = @ScriptDir & '\desktop.bmp' Local $aResult = _BmpImgSearch($In_this_image, $Find_this_image, 0, 0, -1, -1, 30) _ArrayDisplay($aResult)
- 45 replies
-
- handleimgsearch
- image search
-
(and 1 more)
Tagged with:
-
Hi, Here are my thoughts about your opinions: 1. You're right, this is a function that I worte before anything else so I didn't take care it enough because it's just an internal function, most users don't need to take care it much. 2. Because the ImageSearch DLL uses hBitmap for searching, but I want the users just need to input the file path so I have to convert it to hBitmap. 3. Most of AutoIt users do not so familiar to the Struct, so you can make them harder to understand the code. 4. Mình đã đọc và cảm ơn bạn đã góp ý nhé, UDF này mình viết từ khoảng thời gian khá sớm sau khi tìm hiểu về AutoIt và không có UDF nào đáp ứng được nhu cầu của mình về độ linh động và không cần đính kèm DLL khi build. I also moved the BinaryCall.au3, MemoryDll.au3 code to separated file in the new version. My work does not relate to AutoIt after I finished this UDF so I don't have much time to improve or optimize the code. I have created the new version here, you can create the Issue, PR for your optimization or new features. Thank you and I very appreciate your suggestion.
- 45 replies
-
- handleimgsearch
- image search
-
(and 1 more)
Tagged with:
-
Whatever the color is (except alpha color), you just need to add it to the $Transparency parameter like this example:
- 45 replies
-
- handleimgsearch
- image search
-
(and 1 more)
Tagged with:
-
nok reacted to a post in a topic: HandleImgSearch (Image Search with ImageSearchDLL embedded)
-
I've implemented this feature to the code but I haven't made it public yet because I don't have time to test it completely right now. You can access the repo here: https://github.com/lamnhan066/HandleImgSearch/tree/add-transparency You can add 0x000000 (means Black) or 0xFFFFFF (means White) or any color that you want to ignore to the `$Transparency` parameter. You can check it out and give me the feed back if possible so I can merge it to the main repo. Thank you!
- 45 replies
-
- handleimgsearch
- image search
-
(and 1 more)
Tagged with:
-
Deathdn reacted to a post in a topic: HandleImgSearch (Image Search with ImageSearchDLL embedded)
-
It is so easy to make mistakes if you need to capture in a loop and analyze it with multiple functions in 1 capture, so I create build-in _Global functions to mainly manage memory to reduce memory leaks. I think _Static is not enough meaning because it already uses the global variable to manage the captured photo and uses it across other _Global functions.
- 45 replies
-
- handleimgsearch
- image search
-
(and 1 more)
Tagged with:
-
The _HandleImgSearch doesn't depend on where the window is if you're using $device as a handle of that window, it just capture that specific window and search $bmpLocal inside it. If you want to search your whole screen, you can try using this code: $aCords = _HandleImgSearch("", $bmpLocal, $startX, $startY, $startWidth, $startHeight, 70, 20) When you let the handle = "", the UDF will capture your whole screen or your specific area if you want to and search inside it.
- 45 replies
-
- handleimgsearch
- image search
-
(and 1 more)
Tagged with:
-
mutleey reacted to a post in a topic: HandleImgSearch (Image Search with ImageSearchDLL embedded)
-
In your code, I see that you just call `_TestHandle` instead of calling both `_TestHandle` and `_TestHandle2`, so that the STEP 2 doesn't work because it isn't called.
- 45 replies
-
- handleimgsearch
- image search
-
(and 1 more)
Tagged with:
-
KeiosStarqua reacted to a post in a topic: HandleImgSearch (Image Search with ImageSearchDLL embedded)
-
I'm only bring the best way to get the results because the UDF can return multiple positions, so you can modify the UDF yourself to get the result that you want to or just write a function to parse the results, the second way may be easier to do because it won't break the core function of the UDF.
- 45 replies
-
- handleimgsearch
- image search
-
(and 1 more)
Tagged with:
-
How can you do a specific area searching when you don't know these coordinates? Let's look at this function: _HandleImgSearch($hwnd, $bmpLocal, $x = 0, $y = 0, $iWidth = -1, $iHeight = -1, $Tolerance = 15, $MaxImg = 1000) You have to know at least one parameter in $x, $y, $iWidth, $iHeight to search for an area. Let's say you want to search in area [50, 60, 800, 600], so the function will look like: _HandleImgSearch($hwnd, $bmpLocal, 50, 60, 800, 600) and the result is `[1, [10, 20, 50, 50]]` which means it has 1 matched possition at [$x, $y, $width, $height] = [10, 20, 50, 50]. If you want to get the relative to your $hwnd coordinates then you need to add [10 + 50, 20 + 60] = [60, 80]. In addition, if you want to get the relative to your current whole screen coordinates, you need to use WinGetPos to get your current $hwnd coordinates and add the [x, y] coordinates to it like the above.
- 45 replies
-
- handleimgsearch
- image search
-
(and 1 more)
Tagged with:
-
It's a coordinate (left, top) of your search image in the search area.
- 45 replies
-
- handleimgsearch
- image search
-
(and 1 more)
Tagged with:
-
When you create new Form Studio, the script auto create new file named `<name>.isf`, it will auto #include to your main script and open in new form editor. When you create a new control, you need to add the handle name to it which is also the variable name that you can to use anywhere else in your code. For more details, you can open the `<name>.isf` file in your editor to see the source code (it's just AutoIt code and the config created by Form Studio) or using the Generate button to generate the code then you can understand when you look at it.
- 250 replies
-
- isn autoit studio
- isn
-
(and 3 more)
Tagged with:
-
In the current version, the result will relate to the search area, you just need to add (x, y) of the result to your search area coordinates to get the results you need. For instance, you need to search in (30, 40, 300, 300) coordinates and get a result (10, 15) then the result you need is (30 + 10, 40 + 15).
- 45 replies
-
- handleimgsearch
- image search
-
(and 1 more)
Tagged with:
-
lamnhan066 changed their profile photo
-
lamnhan066 reacted to a post in a topic: ISN AutoIt Studio
-
Sykesy reacted to a post in a topic: HandleImgSearch (Image Search with ImageSearchDLL embedded)
-
KaFu reacted to a post in a topic: HandleImgSearch (Image Search with ImageSearchDLL embedded)
-
I found DPI settings in File > Settings > Display > Monitor and windows > Enable High DPI Mode. If your window still have issue after save and close, try reopening that window and press Reset main window view. Hope it help!
- 250 replies
-
- isn autoit studio
- isn
-
(and 3 more)
Tagged with:
-
It's because of your internet connection (This site may be blocked by your internet provider). You should try to change your dns first to open this site, if not then pm me I will send you directly. Here is the download url from that site: https://www.isnetwork.at/phocadownload/138/
- 250 replies
-
- isn autoit studio
- isn
-
(and 3 more)
Tagged with: