Friday, October 06, 2006

TColor type

TColor is used to specify the color of an object.
Unit
Graphics

enum TColor {clMin=-0x7fffffff-1, clMax=0x7fffffff};

Description
TColor is used to specify the color of an object. It is used by the Color property of many components and by a number of other properties that specify color values.

The Graphics unit contains definitions of useful constants for TColor. These constants map either directly to the closest matching color in the system palette (for example, clBlue maps to blue) or to the corresponding system screen element color defined in the Color section of the Windows Control panel (for example, clBtnFace maps to the system color for button faces).

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 0x00FF0000 represents full-intensity, pure blue, 0x0000FF00 is pure green, and 0x000000FF is pure red. 0x00000000 is black and 0x00FFFFFF is white.

If the highest-order byte is zero (0x00), the color obtained is the closest matching color in the system palette. If the highest-order byte is one (0x01), the color obtained is the closest matching color in the currently realized palette. If the highest-order byte is two (0x02), the value is matched with the nearest color in the logical palette of the current device context.
注意: TColor 本身已經是一個最底層的資料型態了, 本身是一個 enum 的型態, 長度為 4 個位元組(bytes) 的整數。

1 comment:

  1. Anonymous3:54 PM

    能請教如何將將BITMAP的圖形資料讀出?
    例如:我有一張圖片..
    我想取得這張圖片的 FILEHEADER,INFOHEADER..
    以及圖形資料..
    我想將圖形資料轉成HEX的格式...
    原本是想用GetPixel(x,y)來取得每點的資料..
    卻卡在不知道有什麼好方法可以操控
    每個byte的每個bit..(初學者..)
    能否指導小弟一下...謝謝~

    ReplyDelete