帮助文档中对Tcolor的说明如下: If you specify TColor as a specific 4-byte hexadecimal number instead of using the constants defined in the Graphics unit, the low three bytes represent RGB color intensities for blue, green, and red, respectively. The value $00FF0000 (Delphi) or 0x00FF0000 (C++) represents full-intensity, pure blue, $0000FF00 (Delphi) or 0x0000FF00 (C++) is pure green, and $000000FF (Delphi) or 0x000000FF (C++) is pure red. $00000000 (Delphi) or 0x00000000 (C++) is black and $00FFFFFF (Delphi) or 0x00FFFFFF (C++) is white. TColor 值是以十六进制进行存储的,低三位分别表示红、绿、蓝三色,就像例子中所说$000000FF红,$0000FF00绿,$00FF0000蓝。 知道其结构组成后由Tcolor转到RGB的分量就非常简单了。 这里用到字符串处理函数,十六进制转十进制函数等(这个转化比较巧妙!)……
|
|