CColorDialog::GetColor

更新 : 2007 年 11 月

DoModal 関数を呼び出した後にこの関数を呼び出すと、選択された色に関する情報を取得できます。

COLORREF GetColor( ) const;

戻り値

色を設定するダイアログ ボックスで選択された色の RGB 情報を持つ COLORREF 値を返します。

使用例

// Get the selected color from the CColorDialog.
CColorDialog dlg;
if (dlg.DoModal() == IDOK)
{
   COLORREF color = dlg.GetColor();
   TRACE(_T("RGB value of the selected color - red = %u, ")
      _T("green = %u, blue = %u\n"),
      GetRValue(color), GetGValue(color), GetBValue(color));
}

必要条件

ヘッダー : afxdlgs.h

参照

参照

CColorDialog クラス

階層図

CColorDialog::SetCurrentColor

その他の技術情報

CColorDialog のメンバ