Jump to content

Scan pixel between two points


dufran3
 Share

Recommended Posts

Was playing around with some things. Not sure if this is useful to anyone or not. Just thought I would throw it out there.

#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>


Opt('PixelCoordMode',1)

_PixelScan(504,215,519,229) ;topleft x, topleft y, bottomright x, bottomright y

Func _PixelScan($left, $top, $right, $bottom)
    $PixelCount = Abs($left - $right)
    Dim $aPixelMap[$PixelCount + 1][3]
    $aPixelMap[$PixelCount][0] = Ubound($aPixelMap)
    ConsoleWrite('Total number of pixels to check: ' &$aPixelMap[$PixelCount][0] & @LF)
    
    For $i = 0 to $aPixelMap[$PixelCount][0] -1
        
        $x = $left + $i
        $y = $top + $i
        $aPixelMap[$i][0] = Hex(PixelGetColor($x, $y),6)
        $aPixelMap[$i][1] = $x
        $aPixelMap[$i][2] = $y
        
        ConsoleWrite('Pixel at: ' & $aPixelMap[$i][1] & ',' & $aPixelMap[$i][2] & ' has color ' & $aPixelMap[$i][0] & @LF)
    NExt
EndFunc
Link to comment
Share on other sites

It looks familiar...

http://www.autoitscript.com/autoit3/docs/functions/PixelChecksum.htm

your right, I was looking for something to read the pixel color at each location, pixelchecksum didn't work. So I didn't rip it off, I knew it existed already...:unsure:

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...