The MASM Forum Archive 2004 to 2012

General Forums => The Workshop => Topic started by: hutch-- on April 05, 2010, 03:13:02 AM

Title: RGB color from point ?
Post by: hutch-- on April 05, 2010, 03:13:02 AM
Has anyone seen, designed or used code that will pick an RGB color from and X Y location on the screen ? I have had a look around but cannot find any obvious way to do this.
Title: Re: RGB color from point ?
Post by: oex on April 05, 2010, 03:15:24 AM
GetPixel Function

http://msdn.microsoft.com/en-us/library/dd144909(VS.85).aspx
Title: Re: RGB color from point ?
Post by: donkey on April 05, 2010, 03:44:01 AM
Be sure to get the screen DC:

invoke GetDC,NULL ; get screen DC
mov hScreenDC, eax
invoke GetPixel,eax,0,0
push eax ; push the color
invoke ReleaseDC,NULL,hScreenDC
pop eax ; pop the color
Title: Re: RGB color from point ?
Post by: hutch-- on April 05, 2010, 04:54:09 AM
Gratsie. :U
Title: Re: RGB color from point ?
Post by: Farabi on April 08, 2010, 12:25:03 PM
Or access the pixel directly from the memory bitmap.