DrawingOptionsScanPathPixelOffset Property

Gets or sets the pixel offset to use for the scanlines when scanning the region of a Path instance.
Default value: Half.

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 PixelOffset ScanPathPixelOffset { get; set; }

Property Value

PixelOffset

Remarks

When filling a Path instance, the region is scanned by horizontal lines (scanlines) to determine which pixels are inside the path. When the value of this property is None, the scanning is performed at the top of the pixels, whereas when it is Half, the scanning is performed at the center of the pixels.

When AntiAliasing is , the pixel offset refers to the subpixels, and the difference is much less noticeable.

Examples

The following images provide a few examples:

DescriptionImage Example
ScanPathPixelOffset = PixelOffset.None, AntiAliasing = : When filling shapes, the scanning of edges occurs at the top of the pixels. The shape in the example has integer vertex coordinates, the top edge is descending, whereas the bottom is ascending 1 pixel from the left to the right. The example is enlarged to show the effect.Almost rectangular shape with ScanPixelOffset = PixelOffset.None
ScanPathPixelOffset = PixelOffset.Half, AntiAliasing = (default): The scanning of edges occurs at the center of the pixels. The shape is the same as above. The example is enlarged to show the effect.Almost rectangular shape with ScanPixelOffset = PixelOffset.Half
ScanPathPixelOffset = PixelOffset.None, AntiAliasing = : When filling shapes, the scanning of edges occurs at the top of the subpixels. When anti-aliasing is enabled, ScanPathPixelOffset makes a much less noticeable difference, though the gradients of the top and bottom lines are a bit different. The example is enlarged to show the effect.Almost rectangular shape with ScanPixelOffset = PixelOffset.None, AntiAliasing = true
ScanPathPixelOffset = PixelOffset.Half, AntiAliasing = : The scanning of edges occurs at the center of the subpixels. The result is almost the same as above, though the gradients of the top and bottom lines are more symmetric. The example is enlarged to show the effect.Almost rectangular shape with ScanPixelOffset = PixelOffset.Half, AntiAliasing = true

See Also