Interface IPenContext
Defines properties and methods for controlling stroke and fill styles in a 2D drawing context, including line caps, joins, width, dashes, and brush settings for fill and stroke.
public interface IPenContext
Properties
GlobalAlpha
Sets the global alpha value for all drawing operations. Range: 0.0 (fully transparent) to 1.0 (fully opaque).
NFloat GlobalAlpha { set; }
Property Value
LineCap
Sets the style of line caps used for strokes.
LineCap LineCap { set; }
Property Value
LineDashOffset
Sets the phase offset for the start of the dash pattern.
NFloat LineDashOffset { set; }
Property Value
LineJoin
Sets the style of line joins between segments.
LineJoin LineJoin { set; }
Property Value
LineWidth
Sets the width of stroked lines, in user space units.
NFloat LineWidth { set; }
Property Value
MiterLimit
Sets the miter limit ratio for miter joins. If the ratio of miter length to line width exceeds this value, a bevel join is used instead.
NFloat MiterLimit { set; }
Property Value
Methods
SetFill(Color)
Sets the fill style to a solid color.
void SetFill(Color color)
Parameters
color
ColorThe fill color.
SetFill(LinearGradient)
Sets the fill style to a linear gradient.
void SetFill(LinearGradient linearGradient)
Parameters
linearGradient
LinearGradientThe gradient to use for filling shapes.
SetFill(RadialGradient)
Sets the fill style to a radial gradient.
void SetFill(RadialGradient radialGradient)
Parameters
radialGradient
RadialGradientThe gradient to use for filling shapes.
SetLineDash(ReadOnlySpan<NFloat>)
Sets the dash pattern used for stroking lines. Each element in the span represents a dash or gap length, alternating.
void SetLineDash(ReadOnlySpan<NFloat> segments)
Parameters
segments
ReadOnlySpan<NFloat>A sequence of dash and gap lengths.
SetStroke(Color)
Sets the stroke style to a solid color.
void SetStroke(Color color)
Parameters
color
ColorThe stroke color.
SetStroke(LinearGradient)
Sets the stroke style to a linear gradient.
void SetStroke(LinearGradient linearGradient)
Parameters
linearGradient
LinearGradientThe gradient to use for stroking paths.
SetStroke(RadialGradient)
Sets the stroke style to a radial gradient.
void SetStroke(RadialGradient radialGradient)
Parameters
radialGradient
RadialGradientThe gradient to use for stroking paths.