幫助文檔中對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藍。 知道其結(jié)構(gòu)組成后由Tcolor轉(zhuǎn)到RGB的分量就非常簡單了。 這里用到字符串處理函數(shù),十六進制轉(zhuǎn)十進制函數(shù)等(這個轉(zhuǎn)化比較巧妙!)……
|
|