Table of Contents

Interface IPenContext

Namespace
Xui.Core.Canvas
Assembly
Core.dll

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

NFloat

LineCap

Sets the style of line caps used for strokes.

LineCap LineCap { set; }

Property Value

LineCap

LineDashOffset

Sets the phase offset for the start of the dash pattern.

NFloat LineDashOffset { set; }

Property Value

NFloat

LineJoin

Sets the style of line joins between segments.

LineJoin LineJoin { set; }

Property Value

LineJoin

LineWidth

Sets the width of stroked lines, in user space units.

NFloat LineWidth { set; }

Property Value

NFloat

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

NFloat

Methods

SetFill(Color)

Sets the fill style to a solid color.

void SetFill(Color color)

Parameters

color Color

The fill color.

SetFill(LinearGradient)

Sets the fill style to a linear gradient.

void SetFill(LinearGradient linearGradient)

Parameters

linearGradient LinearGradient

The gradient to use for filling shapes.

SetFill(RadialGradient)

Sets the fill style to a radial gradient.

void SetFill(RadialGradient radialGradient)

Parameters

radialGradient RadialGradient

The 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 Color

The stroke color.

SetStroke(LinearGradient)

Sets the stroke style to a linear gradient.

void SetStroke(LinearGradient linearGradient)

Parameters

linearGradient LinearGradient

The gradient to use for stroking paths.

SetStroke(RadialGradient)

Sets the stroke style to a radial gradient.

void SetStroke(RadialGradient radialGradient)

Parameters

radialGradient RadialGradient

The gradient to use for stroking paths.