ID2D1DeviceContext1::CreateStrokedGeometryRealization method (d2d1_2.h)

Creates a device-dependent representation of the stroke of a geometry that can be subsequently rendered.

Syntax

HRESULT CreateStrokedGeometryRealization(
  [in]           ID2D1Geometry            *geometry,
                 FLOAT                    flatteningTolerance,
                 FLOAT                    strokeWidth,
  [in, optional] ID2D1StrokeStyle         *strokeStyle,
  [out]          ID2D1GeometryRealization **geometryRealization
);

Parameters

[in] geometry

Type: ID2D1Geometry*

The geometry to realize.

flatteningTolerance

Type: FLOAT

The flattening tolerance to use when converting Beziers to line segments. This parameter shares the same units as the coordinates of the geometry.

strokeWidth

Type: FLOAT

The width of the stroke. This parameter shares the same units as the coordinates of the geometry.

[in, optional] strokeStyle

Type: ID2D1StrokeStyle*

The stroke style (optional).

[out] geometryRealization

Type: ID2D1GeometryRealization**

When this method returns, contains the address of a pointer to a new geometry realization object.

Return value

Type: HRESULT

The method returns an HRESULT. Possible values include, but are not limited to, those in the following table.

HRESULT Description
S_OK No error occurred.
E_OUTOFMEMORY Direct2D could not allocate sufficient memory to complete the call.
E_INVALIDARG An invalid value was passed to the method.

Remarks

This method is used in conjunction with ID2D1DeviceContext1::DrawGeometryRealization. The D2D1::ComputeFlatteningTolerance helper API may be used to determine the proper flattening tolerance.

If the provided stroke style specifies a stroke transform type other than D2D1_STROKE_TRANSFORM_TYPE_NORMAL, then the stroke will be realized assuming the identity transform and a DPI of 96.

Requirements

Requirement Value
Minimum supported client Windows 8.1 [desktop apps | UWP apps]
Minimum supported server Windows Server 2012 R2 [desktop apps | UWP apps]
Target Platform Windows
Header d2d1_2.h
Library D2d1.lib
DLL D2d1.dll

See also

ID2D1DeviceContext1