Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DLL Talk / Problem with GetPixel, (GDI32.dll)

Author
Message
MSon
20
Years of Service
User Offline
Joined: 13th Jul 2004
Location: Earth, (I Think).
Posted: 10th Apr 2008 01:03 Edited at: 10th Apr 2008 01:05
I'm tryng to create a DesktopSnapShot and BlueWindow Snapshot Function, When calling GetPixel in GDI32.DLL, (Windows DLL) it should be returned in RGB, So whats wrong?

http://msdn2.microsoft.com/en-us/library/ms532282.aspx



Everyone Be Cool, You, Be Cool.

Attachments

Login to view attachments
NeX the Fairly Fast Ferret
19
Years of Service
User Offline
Joined: 10th Apr 2005
Location: The Fifth Plane of Oblivion
Posted: 10th Apr 2008 01:33 Edited at: 10th Apr 2008 01:33
Red and blue channels appear to have been swapped. I think that some displays use BGR colours, could this be a cause?

http://msdn2.microsoft.com/en-us/library/ms532655(VS.85).aspx


I fail at life. No, really.
MSon
20
Years of Service
User Offline
Joined: 13th Jul 2004
Location: Earth, (I Think).
Posted: 10th Apr 2008 01:40 Edited at: 10th Apr 2008 01:41
Thats it, Thanks, its working now



Quote: "The GetPixel function retrieves the red, green, blue (RGB) color value of the pixel at the specified coordinates. "


I think that MSDN Page I linked to above needs updating

Everyone Be Cool, You, Be Cool.
jinzai
18
Years of Service
User Offline
Joined: 19th Aug 2006
Location: USA
Posted: 10th Apr 2008 17:48
No, its correct...look at what COLORREF has to say:

Quote: "When specifying an explicit RGB color, the COLORREF value has the following hexadecimal form:

0x00bbggrr The low-order byte contains a value for the relative intensity of red; the second byte contains a value for green; and the third byte contains a value for blue. The high-order byte must be zero. The maximum value for a single byte is 0xFF. "
MSon
20
Years of Service
User Offline
Joined: 13th Jul 2004
Location: Earth, (I Think).
Posted: 10th Apr 2008 17:58 Edited at: 10th Apr 2008 17:58
Fair enouth, you got me, i never read the full page, (Damn, got cort)
I just read the starting section to make sure it was what i wanted

Everyone Be Cool, You, Be Cool.
jinzai
18
Years of Service
User Offline
Joined: 19th Aug 2006
Location: USA
Posted: 10th Apr 2008 18:15
To be fair, its on the page linked to by that, and I never have thought MS was clear. Finding that stuff is a pain with online docs, too.

btw, I only came in here because I thought that was a pretty cool thing you are doing...like your other stuff.

Cheers, and I like the Silent Bob avatar, as well!

Login to post a reply

Server time is: 2024-11-23 03:03:08
Your offset time is: 2024-11-23 03:03:08