Miliardsto Posted December 10, 2018 Share Posted December 10, 2018 (edited) Im wondering if its possible to read pixel colors from not only from top window. For example I got a few windows with images how (in attachment video) . Is it possible to read pixel color for example 200px, 200px from top left ? Can i make something like winlist for the same window names and then get handles for every listed exact name window and then read for every window pixel color for example: 200px, 200px from top left ? https://streamable.com/l3pit 2018-12-10 01-02-38.mp4 Edited December 10, 2018 by Miliardsto Link to comment Share on other sites More sharing options...
Aelc Posted December 10, 2018 Share Posted December 10, 2018 i think its possible. just one question to explain are the windows all @SW_maximize and @SW_show? Miliardsto 1 why do i get garbage when i buy garbage bags? Link to comment Share on other sites More sharing options...
Nine Posted December 10, 2018 Share Posted December 10, 2018 You could do something like this : #include <ScreenCapture.au3> Opt ("MustDeclareVars", 1) Global $ahWnd = WinList ("Something here"), $aHBitMap[$ahWnd[0][0]] For $i = 1 to $ahWnd[0][0] WinActivate ($ahWnd[$i][1]) WinWaitActive ($ahWnd[$i][1]) $aHBitMap[$i-1] = _ScreenCapture_CaptureWnd ("",$ahWnd[$i][1],0,0,200,200,False) Next Miliardsto 1 “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...
Miliardsto Posted December 11, 2018 Author Share Posted December 11, 2018 yes. all show and maximized. I asked a bit wrong question. Hmm thats the right answer to this @Nine Link to comment Share on other sites More sharing options...
Miliardsto Posted December 11, 2018 Author Share Posted December 11, 2018 Is there a possibility to check Pixelgetcolor from for example 3 windows at the same time, in real time, without using screen capturing? 1 window is on top 2,3 windows below the first one These pixels colours would be changing from time to time and in loop I want to check their colors using timers every 5 seconds for example. So making scrrenshots would not be appropriate in this case. Link to comment Share on other sites More sharing options...
Aelc Posted December 11, 2018 Share Posted December 11, 2018 (edited) $hWnd = WinList ("Window","") For $i = 1 to $hWnd[0][0] $Coord = PixelSearch(200, 200, 10, 10, "color" ,"","",$hWnd[$i][1]) If Not @error Then MsgBox(64, "", "X and Y are: " & $Coord[0] & "," & $Coord[1]) EndIf Next you can use the handle of windows in the pixelsearch Edited December 11, 2018 by Aelc why do i get garbage when i buy garbage bags? Link to comment Share on other sites More sharing options...
Nine Posted December 11, 2018 Share Posted December 11, 2018 You can use AdlibRegister ("function", 5000) to launch a function every 5 secs that would check the pixels like @Aelc showed you. Or you can use TimerInit () along with TimerDiff ($hTimer) in a loop until you reach 5 secs. “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...
DonTutti Posted December 11, 2018 Share Posted December 11, 2018 Can You please explain how to do loop with TimerInit? I readed many examples of it but I cant understound it ;/ Link to comment Share on other sites More sharing options...
Nine Posted December 11, 2018 Share Posted December 11, 2018 Global $hTimer = TimerInit (), $iTime While True Do something here or Sleep (50) $iTime = TimerDiff ($hTimer) if $iTime >= 5000 then ; when it reach 5 secs, execute something Do someother things here $hTimer = TimerInit () ; reinit timer endif Wend Self-explanatory. DonTutti 1 “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...
Bert Posted December 11, 2018 Share Posted December 11, 2018 Several things If you want to look at a pic as you show in the video, then why not just look at the pic and not windows explorer view? Why do you need to use pixel searching in the first place? Have you tried to ID the control in question? Using pixel searching is VERY UNSTABLE and causes many scripts to break. What is the ACTUAL application you are wanting to automate? I ask for in MANY CASES there is a script that will do it so having to reinvent the wheel is a waste of time when we can point you in the right direction. Earthshine 1 The Vollatran project My blog: http://www.vollysinterestingshit.com/ 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