DrawingOptionsFastThinLines Property

Gets or sets whether drawing Paths and primitive shapes with thin lines are drawn with a faster algorithm when AntiAliasing is .
Default value: .

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

Property Value

Boolean

Remarks

When FastThinLines is , thin lines (that is, when Pen.Width is less or equal to 1) and arcs are drawn with a Bresenham-like algorithm, which is both faster and produces better results than the default algorithm.

This property has no effect when AntiAliasing is .

Examples

The following images provide a few examples:

DescriptionImage Example
Drawing a Path with AntiAliasing = , FastThinLines = . This is the default configuration of these properties.Path drawn with AntiAliasing = false, FastThinLines = true.
Drawing a Path with AntiAliasing = , FastThinLines = , DrawPathPixelOffset = Half. Note that the lines are more jagged than above.Path drawn with AntiAliasing = false, FastThinLines = false, DrawPathPixelOffset = PixelOffset.Half.
Drawing a Path with AntiAliasing = , DrawPathPixelOffset = Half. The lines are much smoother.Path drawn with AntiAliasing = true, DrawPathPixelOffset = PixelOffset.Half.
Drawing an ellipse with AntiAliasing = , FastThinLines = . The image is zoomed in for better visibility.Zoomed ellipse with AntiAliasing = false, FastThinLines = true.
Drawing an ellipse with AntiAliasing = , FastThinLines = , DrawPathPixelOffset = Half. The image is zoomed in for better visibility.Zoomed ellipse with AntiAliasing = false, FastThinLines = false, DrawPathPixelOffset = PixelOffset.Half.

Though enabling FastThinLines usually produces better results, sometimes it still may be beneficial to disable it. For example, when filling and drawing the same Path without anti-aliasing, in some cases the 1-pixel width outline may not be perfectly aligned with the fill area, unless FastThinLines is disabled:

DescriptionImage Example
Filling and drawing the same polygon with AntiAliasing = , FastThinLines = . You can observe alignment issues.Polygon fill + draw with AntiAliasing = false, FastThinLines = true.
Filling and drawing the same polygon with AntiAliasing = , FastThinLines = . Now there is no alignment issuePolygon fill + draw with AntiAliasing = false, FastThinLines = false.

See Also