Jump to content
Sign in to follow this  
dufran3

Scan pixel between two points

Recommended Posts

dufran3

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

Share this post


Link to post
Share on other sites
Blue_Drache

It looks familiar...

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


Lofting the cyberwinds on teknoleather wings, I am...The Blue Drache

Share this post


Link to post
Share on other sites
dufran3

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:

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  

×