DIBビットマップのカラーテーブルからRGB値を取得する
Declare Function GetDIBColorTable Lib "gdi32.dll" _
(ByVal hdc As Long, ByVal uStartIndex As Long, _
ByVal Centries As Long, pColors As Any) As Long
Declare Function GetDIBColorTable Lib "gdi32.dll" _
(ByVal hdc As Integer, ByVal uStartIndex As Integer, _
ByVal Centries As Integer, pColors As Integer) As Integer
UINT GetDIBColorTable(
HDC hdc,
UINT uStartIndex,
UINT cEntries,
RGBQUAD *pColors
);
System.Drawing.Bitmap.Palette
引数
hdc
デバイスコンテキストのハンドルuStartIndex
このデバイスコンテキストにDIBセクションビットマップが選択されていなければいけない
取得するカラーテーブルの最初のエントリーのインデックス(最初は0)Centries
取得するエントリ数pColors
(戻り値)カラー値を受け取るRGBQUAD構造体戻り値
成功したとき 取得したエントリ数備考
失敗したとき 0
「カラーテーブル」とはカラーパレットのこと。
この関数はhdcにDIBセクションビットマップが選択されている場合にのみ有効