Table of Contents

Enum StrokeTransformType

Namespace
SharpDX.Direct2D1
Assembly
SharpDX.Direct2D1.dll

Defines how the world transform, dots per inch (dpi), and stroke width affect the shape of the pen used to stroke a primitive.

public enum StrokeTransformType

Fields

Fixed = 1

The stroke does not respect the world transform but it does respect the dpi and stroke width.

Hairline = 2

The stroke is forced to 1 pixel wide (in device space) and does not respect the world transform, the dpi, or the stroke width.

Normal = 0

The stroke respects the currently set world transform, the dpi, and the stroke width.

Remarks

If you specify D2D1_STROKE_TRANSFORM_TYPE_FIXED the stroke isn't affected by the world transform.

If you specify D2D1_STROKE_TRANSFORM_TYPE_FIXED the application has the same behavior in Windows 7 and later.

If you specify D2D1_STROKE_TRANSFORM_TYPE_HAIRLINE the stroke is always 1 pixel wide.

Apart from the stroke, any value derived from the stroke width is not affected when the transformType is either fixed or hairline. This includes miters, line caps and so on.

It is important to distinguish between the geometry being stroked and the shape of the stroke pen. When D2D1_STROKE_TRANSFORM_TYPE_FIXED or D2D1_STROKE_TRANSFORM_TYPE_HAIRLINE is specified, the geometry still respects the transform and dpi, but the pen that traces the geometry will not.

Here is an illustration of a stroke with dashing and a skew and stretch transform.

And here is an illustration of a fixed width stroke which does not get transformed.