DrawingOptionsFillMode Property

Gets or sets the fill mode to use when filling shapes.
Default value: Alternate.

See the online help for image examples.

Definition

Namespace: KGySoft.Drawing.Shapes
Assembly: KGySoft.Drawing.Core (in KGySoft.Drawing.Core.dll) Version: 9.0.0
C#
public ShapeFillMode FillMode { get; set; }

Property Value

ShapeFillMode

Remarks

If a polygon has no self-crossing lines, then both fill modes produce the same result, in which case the default Alternate mode can be a better choice because it is faster.

Examples

The following examples demonstrate the difference between the two fill modes:

DescriptionImage Example
FillMode = ShapeFillMode.Alternate (default): When scanning the region of a polygon to be filled, a point is considered to be the part of the polygon if the scanline crosses odd number of lines before reaching the point to be drawn, and is considered not to be the part of the polygon if the scanline crosses even number of lines. This strategy is faster than the NonZero mode, though it may produce "holes" when a polygon has self-crossing lines.FillMode = ShapeFillMode.Alternate
FillMode = ShapeFillMode.NonZero: It considers the direction of the path segments at each intersection, adding/subtracting one at every clockwise/counterclockwise intersection. The point is considered to be the part of the polygon if the sum is not zero.FillMode = ShapeFillMode.NonZero

See Also