CPen::CreatePenIndirect

lpLogPenが指す構造体で指定されたスタイル、幅と色の線でペンを初期化します。

BOOL CreatePenIndirect(
   LPLOGPEN lpLogPen 
);

パラメーター

  • lpLogPen
    Windows LOGPEN をポイントし、構成します。ペンに関する情報が含まれています。

戻り値

正常終了した場合は 0 以外を返します。それ以外の場合は 0 を返します。

解説

大きなあるは、ペン幅が 1 ピクセル PS_NULLPS_SOLID、または PS_INSIDEFRAME のスタイルが存在する必要があります。

ペンに PS_INSIDEFRAME のスタイルと論理カラー テーブルの色と一致しない色がの場合、はディザー カラー ペンで描画します。PS_INSIDEFRAME のスタイルは、ペン幅が 1.以下の場合 PS_SOLID と同じものです。

使用例

LOGPEN logpen;
CPen   cMyPen;

// Get the LOGPEN of an existing pen.
penExisting.GetLogPen(&logpen);

// Change the color to red and the width to 2.
logpen.lopnWidth.x = 2;
logpen.lopnColor = RGB(255, 0, 0);

// Create my pen using the new settings.
cMyPen.CreatePenIndirect(&logpen);

必要条件

ヘッダー: afxwin.h

参照

関連項目

CPen クラス

階層図

CPen::CreatePen

CPen::CPen