CPen::CreatePenIndirect

初始化具有樣式、寬度和色彩 (其中為指定給 lpLogPen點之結構的畫筆。

BOOL CreatePenIndirect(
   LPLOGPEN lpLogPen 
);

參數

  • lpLogPen
    指向 [視窗] LOGPEN 結構包含有關畫筆的資訊。

傳回值

如果不是零,則函式成功,則為 0。

備註

有超過一個寬度為 1 像素的畫筆應該永遠都有 PS_NULLPS_SOLIDPS_INSIDEFRAME 樣式。

如果畫筆會 PS_INSIDEFRAME 樣式和邏輯色彩表中不相符的色彩的色彩,畫筆繪製一經遞色的色彩。如果畫筆寬度小於或等於 1., PS_INSIDEFRAME 樣式與 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);

需求

Header: afxwin.h

請參閱

參考

CPen 類別

階層架構圖

CPen::CreatePen

CPen::CPen