D2D1CAPSTYLE
D2D1CAPSTYLE is a designation used in the Direct2D API to refer to the cap style of stroked lines. It corresponds to the D2D1_CAP_STYLE enumeration and is applied when describing how the ends of strokes are drawn. The cap style governs how line endpoints appear at start and end points, and can also influence dash endpoints when a stroke is dashed.
The D2D1_CAP_STYLE enumeration generally includes several values:
- D2D1_CAP_STYLE_FLAT: ends are cut flush with the end of the path, producing a flat termination.
- D2D1_CAP_STYLE_ROUND: ends have a semicircular cap with a radius equal to half the stroke width.
- D2D1_CAP_STYLE_SQUARE: ends extend beyond the endpoint by half the stroke width, creating a square projection.
- D2D1_CAP_STYLE_TRIANGLE: ends are drawn with a triangular cap that projects beyond the endpoint (used for certain
- D2D1_CAP_STYLE_FORCE_D_UINT32: a sentinel value used to ensure the enumeration is 32-bit in size on all platforms.
In practice, the cap style is specified as part of a stroke description when creating a StrokeStyle
Notes: Availability of certain cap styles can vary by hardware and driver support. For general purpose rendering,