ID2D1Factory::CreateStrokeStyle 方法
创建一个 ID2D1StrokeStyle,该 ID2D1StrokeStyle 描述笔划的起始大写字母、短划线图案和其他功能。
重载列表
方法 | 说明 |
---|---|
CreateStrokeStyle (D2D1_STROKE_STYLE_PROPERTIES&, FLOAT*, UINT, ID2D1StrokeStyle**) | 创建一个 ID2D1StrokeStyle,该 ID2D1StrokeStyle 描述笔划的起始大写字母、短划线图案和其他功能。 |
CreateStrokeStyle (D2D1_STROKE_STYLE_PROPERTIES*、FLOAT*、UINT、ID2D1StrokeStyle**) | 创建一个 ID2D1StrokeStyle,该 ID2D1StrokeStyle 描述笔划的起始大写字母、短划线图案和其他功能。 |
示例
以下示例创建使用自定义短划线模式的笔划。
// Dash array for dashStyle D2D1_DASH_STYLE_CUSTOM
float dashes[] = {1.0f, 2.0f, 2.0f, 3.0f, 2.0f, 2.0f};
// Stroke Style with Dash Style -- Custom
if (SUCCEEDED(hr))
{
hr = m_pD2DFactory->CreateStrokeStyle(
D2D1::StrokeStyleProperties(
D2D1_CAP_STYLE_FLAT,
D2D1_CAP_STYLE_FLAT,
D2D1_CAP_STYLE_ROUND,
D2D1_LINE_JOIN_MITER,
10.0f,
D2D1_DASH_STYLE_CUSTOM,
0.0f),
dashes,
ARRAYSIZE(dashes),
&m_pStrokeStyleCustomOffsetZero
);
}
下一个示例在绘制线条时使用笔划样式。
m_pRenderTarget->DrawLine(
D2D1::Point2F(0, 310),
D2D1::Point2F(200, 310),
m_pCornflowerBlueBrush,
10.0f,
m_pStrokeStyleCustomOffsetZero
);
要求
要求 | 值 |
---|---|
库 |
|
DLL |
|
另请参阅
反馈
https://aka.ms/ContentUserFeedback。
即将发布:在整个 2024 年,我们将逐步淘汰作为内容反馈机制的“GitHub 问题”,并将其取代为新的反馈系统。 有关详细信息,请参阅:提交和查看相关反馈