ID2D1RenderTarget::CreateSolidColorBrush (constD2D1_COLOR_F*,constD2D1_BRUSH_PROPERTIES*,ID2D1SolidColorBrush**) 方法 (d2d1.h)

建立新的 ID2D1SolidColorBrush ,可用來使用純色繪製區域。

語法

HRESULT CreateSolidColorBrush(
  const D2D1_COLOR_F          *color,
  const D2D1_BRUSH_PROPERTIES *brushProperties,
  ID2D1SolidColorBrush        **solidColorBrush
);

參數

color

類型:[in] const D2D1_COLOR_F*

筆刷色彩的紅色、綠色、藍色和Alpha值。

brushProperties

類型:[in] const D2D1_BRUSH_PROPERTIES*

筆刷的基底不透明度。

solidColorBrush

類型: [out] ID2D1SolidColorBrush**

當這個方法傳回時,會包含新筆刷指標的位址。 這個參數會以未初始化的狀態傳遞。

傳回值

類型: HRESULT

如果此方法成功,則會傳回 S_OK。 否則,它會傳回 HRESULT 錯誤碼。

規格需求

需求
目標平台 Windows
標頭 d2d1.h
程式庫 D2d1.lib
Dll D2d1.dll

另請參閱

筆刷概觀

Direct2D 快速入門

ID2D1RenderTarget