Dexter1993 Posted November 28, 2021 Author Share Posted November 28, 2021 Nice one @Nine ! Your a god. Do you have shade-variation too ? Link to comment Share on other sites More sharing options...
Nine Posted November 28, 2021 Share Posted November 28, 2021 Nope, sorry did not implemented that... “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Screen Scraping Multi-Threading Made Easy Link to comment Share on other sites More sharing options...
junkew Posted November 28, 2021 Share Posted November 28, 2021 There are many examples around it really depends on your need and goal Bitblt and gdi Bitblt and c# embedded if you need more speed Fasm for speed Dll written in other language Histogram functions Search with shade variations .... 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...
Nine Posted November 28, 2021 Share Posted November 28, 2021 But you can implement the shade yourself. It is going to slow down the scan though. #include "GetScreen.au3" #include <Color.au3> HotKeySet("{ESC}", _Exit) Local $hWnd = WinActivate("[CLASS:SciTEWindow]") If Not $hWnd Then Exit MsgBox($MB_SYSTEMMODAL, "Error", "Unable to find window") _GetScreen_Initialize(@DesktopWidth, @DesktopHeight) While True ToolTip(_PixelCountInArea(100, 100, 500, 500, 0xFF0000, 10), 600, 500) Sleep(10000) WEnd Func _PixelCountInArea($left, $top, $right, $bottom, $color, $shade = 0) Local $founded = 0, $rgb1, $rgb2 _GetScreen_GetScreen() $rgb1 = _ColorGetRGB($color) For $x = $left To $right For $y = $top To $bottom $rgb2 = _ColorGetRGB(_GetScreen_GetPixel($x, $y)) For $i = 0 to 2 If Abs($rgb1[$i] - $rgb2[$i]) > $shade Then ContinueLoop 2 Next $founded += 1 Next Next Return $founded EndFunc ;==>_PixelCountInArea Func _Exit() Exit EndFunc ;==>_Exit “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Screen Scraping Multi-Threading Made Easy Link to comment Share on other sites More sharing options...
junkew Posted November 29, 2021 Share Posted November 29, 2021 (edited) Your question started with pixelcounting but looking at you skyarea picture you are in need of more imagelogic Maybe you can find some logic in picture effects getImage from findbmp or https://www.autoitscript.com/wiki/FAQ#How_can_I_search_an_image_in_another_image.3F and search in the forum for _GDIPlus_BitmapLockBits or in general look at all _GDI functions for colormatrix, histogram, ..... https://www.autoitscript.com/autoit3/docs/libfunctions/_GDIPlus_BitmapLockBits.htm When you have the bits (as a binarystringsequence of bytes) you can quickly search them in many algorithms where going pixel by pixel can be slow so first step is to bring down the area of interest. So first search in an 8-bit color picture. edit: you can get some ideas with C# for speeding things up, there are examples how to integrate C# with AutoIt https://napuzba.com/fast-image-processing-in-csharp/ Edited December 1, 2021 by junkew 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...
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