Joe Strazzere - All Things Quality

Visit my new blog at http://strazzere.blogspot.com/


December 1, 2005 - WinTask - GetPixel

Posted in WinTask

'
' GetPixel - get the pixel at a particular point on the screen
'

dim ptr as unsigned
dim ptr2 as unsigned

ptr=allocate(16)
ptr2=ptr+0
pokeinteger(ptr2,0,4)
ptr2=ptr+4
pokeinteger(ptr2,0,4)
ptr2=ptr+8
pokeinteger(ptr2,640,4)
ptr2=ptr+12
pokeinteger(ptr2,32,4)

hdc=External("gdi32","CreateDCA","DISPLAY",0,0,0)

x=1279 
y=1023

pixel=External("gdi32", "GetPixel", hdc, x, y)
   
External("gdi32","DeleteDC")

blue = pixel / 65536
green = (pixel - (blue * 65536)) / 256
red = pixel - (blue * 65536) - (green * 256)

msgbox("Pixel value of ("+str$(x)+","+str$(y)+") = "+str$(pixel)+crlf+crlf+"Red = "+str$(red)+crlf+"Green = "+str$(green)+crlf+"Blue = "+str$(blue),,"GetPixel")

 


<- Last Page :: Next Page ->

About Me

A gathering place for information and ideas about Quality Assurance, Testing, and other useful topics.

Problems cannot be solved by the same level of thinking that created them. - A. Einstein

Search This Site

Translate This Site

RSS Feed

Subscribe

Twitter

@jstrazzere

Categories

Life
QA
Sports
Tools
WinTask
Work in General

What I'm Reading Now