PocketMatrix forums

A read-only archive of the PocketMatrix forums (2001–2014). Posting and accounts are closed.

Get and Set pixel functions

BCIT Victim · 03 Dec 2002, 23:16 UTC
Hey, I'm a second year comp sci student in Vancouver British Columbia, with a bit of a pickle on my hands.
We're using the get and set pixel functions in the Cgapisuface. When you do a "==" comparison on the result of the pixel they will not match. ie) I set a pixel with a color, and then get that pixel's color and compare the result to the original color. This will return false. I am wondering if there is a problem in these functions or any help would be large. To my understanding a COLORREF is stored bitwise as 0x00bbggrr. Thanks for any help you guys could lend.

cheers
Epinephrine
I second this behavoir, i've tried doing many different things such and using bitmasks to compare results.

Is this the desired behavor? if so, whats the point of getpixel?
I dont know but the problem could be that you have a 16 or 12 bit surface, and setting a 24 bit color value as 0xrrggbb will make GapiDraw to pick the nearest color that matches your 24-bit color. And when you read it out it will return a another color but similar.
BCIT Victim · 04 Dec 2002, 11:42 UTC
Thanks, you just helped me out big time.

Cheers
Epinephrine