vulcan4d Posted June 24, 2020 Posted June 24, 2020 I'm troubleshooting my script and I understand the directions of PixelSearch. The problem I'm having, Pixelsearch picks up the adjacent pixel which is not the one I want because it scans horizontally. Does not matter from where I start, it scans the horizontally and gets the wrong pixel I want. Below is an example. I want to find the most far point red pixel on the right. First I need to scan from the right because I want the one furthest on the right. If I scan from left/top or right/top I get #1. If I scan from right/top or right/bottom I get #3. You see, I simply can't find #2 being the rightmost red pixel. For this to occur I would need to scan the pixels vertically from the right. It would have to scan the pixels from top to bottom as it moves to the left and then it would find #2. Any suggestions how to accomplish this?
Nine Posted June 24, 2020 Posted June 24, 2020 Try this : Const $left = 100, $top = 150, $right = 600, $bottom = 500 Local $pos For $x = $right To $left Step -1 $pos = PixelSearch ($x, $top, $x, $bottom, 0xFF0000) If Not @error Then ExitLoop Next If IsArray($pos) Then ConsoleWrite ($pos[0] & "/" & $pos[1] & @CRLF) “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) Debug Messages Monitor UDF Screen Scraping Round Corner GUI UDF Multi-Threading Made Easy Interface Object based on Tag
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