Jump to content
Sign in to follow this  
ConsultingJoe

Pixelsearch A 2x2 Square

Recommended Posts

ConsultingJoe

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]

Share this post


Link to post
Share on other sites
big_daddy

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

Could you not use PixelChecksum()?

Share this post


Link to post
Share on other sites
ConsultingJoe

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]

Share this post


Link to post
Share on other sites
SmOke_N

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.

Share this post


Link to post
Share on other sites
big_daddy

This will work if the colors are always in the same order.

Use this to record the 2x2 square of colors.

Then use this to find what you recorded.

Just modify it to do what you want after it finds it.

Share this post


Link to post
Share on other sites
ConsultingJoe

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]

Share this post


Link to post
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
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.