DrawingOptionsDrawPathPixelOffset Property

Gets or sets the pixel offset to use before applying the Pen.Width when drawing a shape.
Default value: None.

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

Property Value

PixelOffset

Remarks

When drawing a shape, the pen width is applied around the path. When the value of this property is Half, the point coordinates of the path are shifted by half a pixel before applying the pen width.

When FastThinLines is and AntiAliasing is , and all points are at integer coordinates, the value of this property makes no difference.

Examples

The following images provide a few examples:

DescriptionImage Example
DrawPathPixelOffset = PixelOffset.None (default): When drawing paths, the point coordinates are not adjusted before applying the pen width. When AntiAliasing is , for polygons with every point at integer coordinates, this causes blurry horizontal and vertical lines for odd pen widths and sharp ones for even pen widths. The left rectangle was drawn with a 1 pixel wide pen, and the right one with a 2 pixel wide pen.Rectangles with DrawPathPixelOffset = PixelOffset.None
DrawPathPixelOffset = PixelOffset.Half: The point coordinates are shifted by a half pixel right and down before applying the pen width. When AntiAliasing is , for polygons with every point at integer coordinates, this causes sharp horizontal and vertical lines for odd pen widths and blurry ones for even pen widths. The left rectangle was drawn with a 1 pixel wide pen, and the right one with a 2 pixel wide pen.Rectangles with DrawPathPixelOffset = PixelOffset.Half

See Also