Jump to content

Pixelsearch A 2x2 Square


Recommended Posts

I want it to let me know when all 4 pixels are equal to the right colors and are in the right order

I don't know how to do it. It would be a cool UDF to have. Any Ideas, Please help, Thanks

[center]AutoIT + Finger Print Reader/Scanner = COOL STUFF -> Check Out Topic![/center][center][font=Arial Black]Check out ConsultingJoe.com[/font][/center][center]My Scripts~~~~~~~~~~~~~~Web Protocol Managing - Simple WiFi Scanner - AutoTunes - Remote PC Control V2 - Audio SpectrascopePie Chart UDF - At&t's TTS - Custom Progress Bar - Windows Media Player Embed[/center]

Link to comment
Share on other sites

Could you not use PixelChecksum()?

no because that just tells me if there different, I need it to tell me if pixel 1=00ff00 2=33ff00 3=ff0000 and 4=000000 and if each is equal to that then output where this is

[center]AutoIT + Finger Print Reader/Scanner = COOL STUFF -> Check Out Topic![/center][center][font=Arial Black]Check out ConsultingJoe.com[/font][/center][center]My Scripts~~~~~~~~~~~~~~Web Protocol Managing - Simple WiFi Scanner - AutoTunes - Remote PC Control V2 - Audio SpectrascopePie Chart UDF - At&t's TTS - Custom Progress Bar - Windows Media Player Embed[/center]

Link to comment
Share on other sites

  • Moderators

no because that just tells me if there different, I need it to tell me if pixel 1=00ff00 2=33ff00 3=ff0000 and 4=000000 and if each is equal to that then output where this is

2 For Loops, an $x and a $y.
Opt('PixelCoordMode', 2)
Local $xCoord[3] = ['', 344, 345], $yCoord[3] = ['', 5, 6], $Color[5] = ['', 0x00FF00, 0x33FF00, 0xFF0000, 0x000000]
Local $Count = 0

For $x = 1 To 2
    For $y = 1 To 2
        $PixColor = PixelGetColor($xCoord[$x], $yCoord[$y])
        For $iColorCount = 1 To 4
            If ($PixColor == $Color[$iColorCount]) Then
                $Count += 1; Whatever your doing here
                ExitLoop
            EndIf
        Next
    Next
Next

MsgBox(0, 'Test', 'The Colors were found ' & $Count & ' Times')

Edit

I didn't notice you had 4 colors you were looking for... Put those in an array also.

Edited by SmOke_N

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

Thanks a lot guys, that was very helpful

[center]AutoIT + Finger Print Reader/Scanner = COOL STUFF -> Check Out Topic![/center][center][font=Arial Black]Check out ConsultingJoe.com[/font][/center][center]My Scripts~~~~~~~~~~~~~~Web Protocol Managing - Simple WiFi Scanner - AutoTunes - Remote PC Control V2 - Audio SpectrascopePie Chart UDF - At&t's TTS - Custom Progress Bar - Windows Media Player Embed[/center]

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...