Board index » cppbuilder » Re: ScanLine pixel color ( Convert TColor to Byte )

Re: ScanLine pixel color ( Convert TColor to Byte )


2003-11-25 08:48:12 PM
cppbuilder10
Thanks,
so, with Byte, I have a more accurate processing ? If it is the case, then it
is what I need. However, how can I do in order to get the Byte correspondance
of a Tcolor value (but still having the same color at the end ) ?
Claude
 
 

Re:Re: ScanLine pixel color ( Convert TColor to Byte )

hi there,
"TADONKI Claude" < XXXX@XXXXX.COM >wrote in message
Quote
Thanks,
so, with Byte, I have a more accurate processing ? If it is the case, then
it
is what I need. However, how can I do in order to get the Byte
correspondance
of a Tcolor value (but still having the same color at the end ) ?
Claude
u can use unions,
eg:
union ColorComp
{
TColor Color;
byte ColorComponent[4];
};
// to get the RGB
ColorComp cc;
// Read the color using ScanLine, int as Pointer RowIn (TColor *RowIn)
cc.Color = RowIn[i];
ShowMessage(cc.ColorComponent[0]); // Red
ShowMessage(cc.ColorComponent[1]); // Green
ShowMessage(cc.ColorComponent[2]); // Blue
hope this is of some help to u :-)
-Dumboo