Gianni Posted November 28, 2021 Share Posted November 28, 2021 On 8/24/2021 at 4:40 PM, Nine said: ..... Added DLL source code to Zip file. ?? Chimp small minds discuss people average minds discuss events great minds discuss ideas.... and use AutoIt.... Link to comment Share on other sites More sharing options...
Nine Posted November 28, 2021 Author Share Posted November 28, 2021 @Chimp Yes I removed the source code from the zip file. It is an AutoIt example, not a FreeBasic example. Also, corrected a small bug. New version available. “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...
Musashi Posted November 28, 2021 Share Posted November 28, 2021 24 minutes ago, Nine said: Also, corrected a small bug. New version available. Note (just a minor detail) : The header still indicates 2021-08-26 as the date of the last modification. #include-once #include <ScreenCapture.au3> ; #DESCRIPTION# ================================================================================================================= [...] ; Date ..........: 2021-08-21 ; Modified ......: 2021-08-26 "In the beginning the Universe was created. This has made a lot of people very angry and been widely regarded as a bad move." Link to comment Share on other sites More sharing options...
Nine Posted November 28, 2021 Author Share Posted November 28, 2021 @Musashi Thanks. Corrected. “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...
Gianni Posted November 28, 2021 Share Posted November 28, 2021 (edited) 14 hours ago, Nine said: @Chimp Yes I removed the source code from the zip file. It is an AutoIt example, not a FreeBasic example. ok Edited November 29, 2021 by Chimp removed joke Chimp small minds discuss people average minds discuss events great minds discuss ideas.... and use AutoIt.... Link to comment Share on other sites More sharing options...
SaeidN Posted April 17, 2022 Share Posted April 17, 2022 Why it takes an all black screenshot of Discord app? Discord class is "Chrome_WidgetWin_1" Also, anyway to open and see the screenshot? Link to comment Share on other sites More sharing options...
Nine Posted April 17, 2022 Author Share Posted April 17, 2022 GetWindow does not work on Chrome, you will need to use GetScreen. The result is a GDI+ handle. Search the forum for examples how to draw a GUI picture from GDI+. If you have problem with this, start a new thread in "AutoIt General Help and Support" section. “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...
Nine Posted April 17, 2022 Author Share Posted April 17, 2022 @SaeidN Found a way but it will only work on Win 10 (and over I suppose, but I don't have Win 11 to test it). Give me a few min to make the patch available. SaeidN 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...
Nine Posted April 17, 2022 Author Share Posted April 17, 2022 Added support for Chromium based applications and other that do not support WM_PRINT or WM_PRINTCLIENT messages New version available SaeidN 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...
SaeidN Posted April 22, 2022 Share Posted April 22, 2022 (edited) Really appreciate your work. How can I take a screenshot of a window (Chromium based), but from pixel 300,80 to 950,940 using this ScreenGet ? I was using: ScreenCapture_Capture("",$left,$top,$right,$bottom,False) Another question: the above gives an Hbitmap, and then convert it to bitmap, and set TIFF parameters in order to increase the quality and readability of OCR. Any way I can do it using the image that your screenget file gets ? Edited April 22, 2022 by SaeidN Link to comment Share on other sites More sharing options...
Nine Posted April 22, 2022 Author Share Posted April 22, 2022 (edited) My UDF always starts at 0,0. You can manipulate (resize, enhance, etc) the bitmap result (see _GetScreen_GetBitMap) with GDI+ in any way you want... Edited April 22, 2022 by Nine SaeidN 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...
Patrik96 Posted June 27, 2022 Share Posted June 27, 2022 Thanks a ton for this! Helped me out a lot Do you think there may be a way to "reverse" _GetScreen_PixelReplaceAll? I basically want to remove all pixels but exclude a specific one, so that everything but pixels with the corresponding color will be removed. Looked at your udf couldnt get an idea to do this properly 😕 Link to comment Share on other sites More sharing options...
Nine Posted July 4, 2022 Author Share Posted July 4, 2022 (edited) @Patrik96Here a function that you could try. If images are not too too big, you should get a decent response time. Func ClearAll($nColorPreserved, $nColorClear) Local $iSize = $iGS_Width * $iGS_Height $nColorPreserved = BitOR($nColorPreserved, 0xFF000000) $nColorClear = BitOR($nColorClear, 0xFF000000) For $i = 1 To $iSize If DllStructGetData($tGS_Struct, "color", $i) <> $nColorPreserved Then DllStructSetData($tGS_Struct, "color", $nColorClear, $i) Next EndFunc Edited July 5, 2022 by Nine Patrik96 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...
Patrik96 Posted July 12, 2022 Share Posted July 12, 2022 On 7/4/2022 at 10:26 PM, Nine said: @Patrik96Here a function that you could try. If images are not too too big, you should get a decent response time. Func ClearAll($nColorPreserved, $nColorClear) Local $iSize = $iGS_Width * $iGS_Height $nColorPreserved = BitOR($nColorPreserved, 0xFF000000) $nColorClear = BitOR($nColorClear, 0xFF000000) For $i = 1 To $iSize If DllStructGetData($tGS_Struct, "color", $i) <> $nColorPreserved Then DllStructSetData($tGS_Struct, "color", $nColorClear, $i) Next EndFunc I'm so sorry for the very late response. Tried it today and it works like intended! Didn't think it would be such as short code^^ Learning a lot from your code. Thank you! The only last step i need to take is to implement some kind of shade variation, because for some reason, specific GPU's appear to have slighty different pixel colors than my own GPU has. My script will run on different devices(Computer room of my fathers company). I wish there would be way to have the 100% same color on every single device. But guess looking for shade variation is the better choice 😏 Link to comment Share on other sites More sharing options...
Nine Posted July 13, 2022 Author Share Posted July 13, 2022 @Patrik96 Make sure you have the same settings between computers. If one has 16 bits colors and the other one has 32, that might explain the differences. Look also at other settings (aero, resolution, zoom, etc). Implementing with AutoIt a shade variation on a large picture will drastically increase the response time. It is important that you understand why there is color differences. “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...
Patrik96 Posted July 17, 2022 Share Posted July 17, 2022 (edited) On 7/13/2022 at 3:35 AM, Nine said: @Patrik96 Make sure you have the same settings between computers. If one has 16 bits colors and the other one has 32, that might explain the differences. Look also at other settings (aero, resolution, zoom, etc). Implementing with AutoIt a shade variation on a large picture will drastically increase the response time. It is important that you understand why there is color differences. We really tried everything to get the 100% exact same Pixel colors on every device. But it seems to be not possible, unless every device uses the same gpu. Tried to install fresh Windows 10 to 3 devices. 2 of them got the same graphics card, where Pixel colors were exact the same. But the third one had a different graphics card and different Pixel colors as well. All of them used the same monitor, so i think there is no way around handling pixel variations... The pictures it uses are about 539 x 329, which luckily isn't too big. Do you think it would be possible to add some kind of pixel variation "detection" to _GetScreen_SearchArea without loosing too much performance? As for _GetScreen_GetPixel($iX, $iY), i simply use the returned color with the following function: ;Returns 1 if pixel is within the set shade variance, 0 if it is not. ;$RBG = the color you are looking for ;$pixel = the actual color of the pixel ;$shade the ammount of variance allowed. I think its 0-255. Func CheckColorVariation($RBG, $pixel, $shade = 0) $difference = 0 $mask = BitAND($RBG, 0xff0000) $mask = BitShift($mask, 16) $pix = BitAND($pixel, 0xff0000) $pix = BitShift($pix, 16) $difference = abs($mask-$pix) If $difference > $shade Then Return 0 EndIf $mask = BitAND($RBG, 0x00ff00) $mask = BitShift($mask, 8) $pix = BitAND($pixel, 0x00ff00) $pix = BitShift($pix, 8) $difference = abs($mask-$pix) If $difference > $shade Then Return 0 EndIf $mask = BitAND($RBG, 0x0000ff) $pix = BitAND($pixel, 0x0000ff) $difference = abs($mask-$pix) If $difference > $shade Then Return 0 EndIf Return 1 EndFunc It works great, however i have no idea how to properly implement this function into _GetScreen_SearchArea since it returnes coordinates instead of colors. Any idea? 😕 Edited July 17, 2022 by Patrik96 Link to comment Share on other sites More sharing options...
Developers Jos Posted July 17, 2022 Developers Share Posted July 17, 2022 2 hours ago, Patrik96 said: Any idea? 😕 Maybe the annoying black background you have even when posting? (Maybe next time Past without formatting! ) Patrik96 1 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. Link to comment Share on other sites More sharing options...
Patrik96 Posted July 17, 2022 Share Posted July 17, 2022 (edited) 48 minutes ago, Jos said: Maybe the annoying black background you have even when posting? (Maybe next time Past without formatting! ) Oh lol it took me a few minutes to realize what you are talking about I am using the "AutoIt Dark" theme of the forums, where this is coming from i guess. Can't see the annoying black background on this theme as well. Hopefully this post doesn't include it 😏 Edit: Alright removed it, thanks for telling. It really looked weird Edit 2: Hands up it was because of c&p from Discord where i prepared text on mobile before posting it here. So this points it pretty good: (Maybe next time Past without formatting! ) Edited July 17, 2022 by Patrik96 Link to comment Share on other sites More sharing options...
Nine Posted July 17, 2022 Author Share Posted July 17, 2022 (edited) 4 hours ago, Patrik96 said: Do you think it would be possible to add some kind of pixel variation "detection" to _GetScreen_SearchArea without loosing too much performance? I believe that it will do impact the performance. Since I am using my UDF and I need top performance, I am afraid I will not implement this. Beside, if I was to implement shade variation to this particular function, I would also need to do the same for the other functions. Why dont you pass a parameter to your script and search for the corresponding color accordingly. It would be very easy to implement it : Global Const $COLOR_A = $CmdLine[1] = 1 ? 0x101010 : 0x121212 Edited July 17, 2022 by Nine “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...
pixelsearch Posted November 9, 2022 Share Posted November 9, 2022 Great job Nine ! Just a note concerning "Example2", which throws a fatal error in my case : error at line 24 ==> Subscript used on non-accessible variable.: Local $aArea = _GetScreen_SearchArea($aPos[0]-50, $aPos[1]-50, $aPos[0]+60, $aPos[1]+60, $iColor) Local $aArea = _GetScreen_SearchArea($aPos^ ERROR The reason is simple : there is no bright red ($iColor = 0xFF0000) in my Scite screen, where the example is opened and run, because of this line in my SciTEUser.properties file : #string (darker red, not the original bright one) style.au3.7=fore:#C80000,back:#F0F4F9 As soon as I comment the string style line (#) and close/reopen Scite, then Example2 works fine because strings retrieve their bright red color 0xFF0000 Anyway, no big deal, if one day you got a major update, then you'll advise. Don't know why but it just reminded me of someone who often writes "check @error as much as you can !" . No Melba23, that's not you This was pixelsearch's note concerning pixelsearch, end of transmission. 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