Jump to content

Patrik96

Members
  • Posts

    6
  • Joined

  • Last visited

Patrik96's Achievements

Seeker

Seeker (1/7)

0

Reputation

  1. 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! )
  2. 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? 😕
  3. 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 😏
  4. Is there a min. size the picture has to be? Because for small pictures(139x26 in my case) it doesnt work. However if i make the picture bigger without changing the size of the text, it will detect it properly. I have attached both files. The first one (Test.jpg) doesnt work. The second bigger one (Test2.jpg) does work Any clue whats going on?
  5. 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 😕
  6. Hey guys. I am looking for a solution for many days, but couldn't find something that helps. (Posted the same question on Discord already and now trying to reach some more people here :)) I'm using the Webview2 UDF to create an embedded browser into my GUI. What i want do to now is, to detect some event depening on pixels(sadly pixels is the only way). Then my script would start a timer to show me how long the event lasts.(Basically want it to run 24/7 so it monitors permanently). This is how i quickly tested it: $handle = WinGetHandle("WebView2 Sample") $hdc = _WinAPI_GetDC ( $handle ) $pix=_WinAPI_GetPixel($hdc, 400 , 400) ;Need to do it via device context, otherwise my browser cannot be in background(not minimized, just behind other windows so i can keep using my pc) MsgBox(4096,"",Hex($pix,6)) While this doesn't work for WebView2, because it always gives me the same Pixelcolor over and over again for an empty window, it does work for FireFox.(Bot not for Chrome, lol) Alright, so i tho i am smart and simply added Firefox as a parent to my GUI using: _WinAPI_SetParent. However _WinAPI_GetPixel stops working if used on a Parent Window. And this is where the actual problem is. For some reason it cannot find any Pixel on a Parent. Even _WinAPI_PrintWindow returns a pure black image if used on parents. Anyone got an idea why this is happening or if i'm actually missing something? I could stick to Firefox itself without embedding it into my GUI, however my goal is to get this working like described above...
×
×
  • Create New...