c7aesa7r 0 Posted January 19, 2020 (edited) expandcollapse popup#include <WinAPI.au3> #include <GDIPlus.au3> #include <ScreenCapture.au3> $Title = "New Tab - Brave" $Hwnd = WinGetHandle($Title) ConsoleWrite("Handle "&$Hwnd&@CRLF) Local $BMP $xTime = TimerInit() $X = 0 $Y = 0 $Color = GetColor($x, $y, $hwnd) ConsoleWrite("Pixel COlor "&$Color&@CRLF) While 1 $aPixelColor = _GDIPlus_BitmapGetPixel($BMP, $X, $Y) $X = $X + 1 $R = Hex($aPixelColor, 6) ConsoleWrite(Dec($R) & @CRLF) If $X = 1920 Then ExitLoop WEnd $yTime = TimerDiff($xTime) ConsoleWrite("Time " & $yTime) Func GetColor($iX,$iY,$WinHandle) _GDIPlus_Startup() Local $aPos = WinGetPos($WinHandle) $iWidth = $aPos[2] $iHeight = $aPos[3] Local $hDDC = _WinAPI_GetDC($WinHandle) Local $hCDC = _WinAPI_CreateCompatibleDC($hDDC) $hBMP = _WinAPI_CreateCompatibleBitmap($hDDC, $iWidth, $iHeight) _WinAPI_SelectObject($hCDC, $hBMP) DllCall("User32.dll", "int", "PrintWindow", "hwnd", $WinHandle, "hwnd", $hCDC, "int", 0) _WinAPI_BitBlt($hCDC, 0, 0, $iWidth, $iHeight, $hDDC, 0, 0, $__SCREENCAPTURECONSTANT_SRCCOPY) $BMP = _GDIPlus_BitmapCreateFromHBITMAP($hBMP) $aPixelColor = _GDIPlus_BitmapGetPixel($BMP, $iX, $iY) ;_WinAPI_ReleaseDC($WinHandle, $hDDC) ;_WinAPI_DeleteDC($hCDC) ;_WinAPI_DeleteObject($hBMP) ;_GDIPlus_ImageDispose($BMP) ;_GDIPlus_Shutdown() $P = Hex($aPixelColor, 6) Return Dec($P) EndFunc ;==>GetColor While 1 ;$BMP = _GDIPlus_BitmapCreateFromHBITMAP($hBMP) $aPixelColor = _GDIPlus_BitmapGetPixel($BMP, $X, $Y) $X = $X + 1 $R = Hex($aPixelColor, 6) ConsoleWrite(Dec($R) & @CRLF) If $X = 1920 Then $X = 0 $Y = $Y + 1 EndIf If $Y = 1080 Then ExitLoop Wend Any way to speed the searching? Took: Time 79340.229 on a 1920x1080 Do someone know if FastFind: 1. Possible to search pixel on background windows? 2. Search pixel inside a file image 3. Instead capturing a print, load it from a file https://www.autoitscript.com/forum/topic/126430-advanced-pixel-search-library/ Is possible capture images from background windows, if could make fastfind use it instead capturing the screen, then could be possible use ff to search pixels on back windows Edited January 19, 2020 by c7aesa7r Share this post Link to post Share on other sites
Melba23 3,407 Posted January 19, 2020 c7easa7r, It looks as if you are trying to automate a game: "Brave". Is this in fact the case? M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Share this post Link to post Share on other sites
c7aesa7r 0 Posted January 19, 2020 (edited) You are obsessed about people asking for game automate? Brave is a browser like chrome,firefox,etc, you could had searched before, as some of you always like to tell people to go read help file. 🤭 Edited January 19, 2020 by c7aesa7r Share this post Link to post Share on other sites
JLogan3o13 1,623 Posted January 19, 2020 (edited) 5 minutes ago, c7aesa7r said: you are obsessed about people asking for game automate? brave is a browser like chrome,firefox,etc, you could had searched before, as some of you always like to tell people to go read help file. 🤭 And you could realize that a simple question was being asked, by someone who has the authority to do so, and choose not to be childish in answering. Or, you could have specified that you are trying to automate the Brave browser and you would have been directed toward UIAutomation as a stable way to do what you're after rather than trying to hack at it with Pixel Searches. Edited January 19, 2020 by JLogan3o13 "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Share this post Link to post Share on other sites
Melba23 3,407 Posted January 19, 2020 c7easa7r, There is no need to get all excited - the game reference came up first when I searched. You might note that I asked politely and did not just lock the thread, so I fail to see why you took such an aggressive stance. Just chill a bit. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Share this post Link to post Share on other sites
Danp2 890 Posted January 19, 2020 Since Brave is based on Chromium, you may be able to use Chromedriver and the Webdriver UDF to automate it. [UDF] WebDriver Latest version Wiki FAQs Share this post Link to post Share on other sites
c7aesa7r 0 Posted January 19, 2020 I thank you if could stop the drama, and I don’t took an aggressive stance, it’s up to you, keep focus on the topic JLogan Ui automation wouldn’t help. Looking for a way to search pixel in back windows, my actual script takes so long to scan the screen Share this post Link to post Share on other sites
Jos 2,165 Posted January 19, 2020 41 minutes ago, c7aesa7r said: I thank you if could stop the drama, and I don’t took an aggressive stance, it’s up to you, keep focus on the topic What a load of bullocks and you know it, so let me add to you drama: you did have a very impolite answer to the simple question asked and you choose to remain sort of agressive in your last answer so what about trying to dim it or else i/we have no hesitation to shut you up....and yes this is also an agressive tone but that happens when you behave as an idiot. Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Share this post Link to post Share on other sites
Nine 930 Posted January 19, 2020 Could you explain what is it you try to achieve beside the technical issue ? Maybe understanding the end result of your automation would help us to provide a better solution ? 1 Danp2 reacted to this Not much of a signature, but working on it... Spoiler Block all input without UAC Save/Retrieve Images to/from Text Tool to search content in au3 files Date Range Picker Sudoku Game 2020 Overlapped Named Pipe IPC x64 Bitwise Operations Fast and simple WCD IPC GIF Animation (cached) Share this post Link to post Share on other sites
c7aesa7r 0 Posted January 19, 2020 (edited) Jos I don’t care about anything you say or think so Nine I’m trying search for pixels in back windows, I already achieved it with the script I post, but takes long for a full scan Edited January 19, 2020 by c7aesa7r Share this post Link to post Share on other sites
Nine 930 Posted January 19, 2020 Just now, c7aesa7r said: Nine I’m trying search for pixels in back windows, I already achieved it with the script I post, but takes long I know that, I looked at your code. But why ? I hardly can think of a browser application you could automate by searching pixel colors to be honest. Not much of a signature, but working on it... Spoiler Block all input without UAC Save/Retrieve Images to/from Text Tool to search content in au3 files Date Range Picker Sudoku Game 2020 Overlapped Named Pipe IPC x64 Bitwise Operations Fast and simple WCD IPC GIF Animation (cached) Share this post Link to post Share on other sites
JLogan3o13 1,623 Posted January 19, 2020 (edited) 32 minutes ago, c7aesa7r said: Jos I don’t care about anything you say or think so Come back when you have given up on the crap attitude. Not in the mood for babysitting today. Edited January 19, 2020 by JLogan3o13 1 Musashi reacted to this "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Share this post Link to post Share on other sites
Jos 2,165 Posted January 19, 2020 (edited) 1 hour ago, c7aesa7r said: Jos I don’t care about anything you say or think so Same here so keep it and you'll get naughty spot time Edited January 19, 2020 by Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Share this post Link to post Share on other sites