为笔划属性的 SVG 字形提供值。 不透明度设置为 1 的画笔用作“上下文笔划”。 画笔的不透明度用作“context-stroke-opacity”值。
语法
HRESULT SetStroke(
  [in, optional] ID2D1Brush  *brush,
                 FLOAT       strokeWidth,
  [in, optional] const FLOAT *dashes,
                 UINT32      dashesCount,
                 FLOAT       dashOffset
);
参数
[in, optional] brush
类型: ID2D1Brush*
描述笔划的绘制方式。 空画笔将导致上下文笔划值为 none。
strokeWidth
类型: FLOAT
指定“stroke-width”属性的“context-value”。
[in, optional] dashes
类型: const FLOAT*
指定“stroke-dasharray”属性的“context-value”。 null 值将导致笔划划线数组设置为“none”。
dashesCount
类型: UINT32
短划线数组中的短划线数。
dashOffset
类型: FLOAT
指定“stroke-dashoffset”属性的“context-value”。
返回值
类型: HRESULT
此方法返回 HRESULT 成功或错误代码。
要求
| 要求 | 值 | 
|---|---|
| 目标平台 | Windows | 
| 标头 | d2d1_3.h | 
| DLL | D2d1.dll |