Click or drag to resize
CanvasTextAntialiasing Enumeration
Specifies the antialiasing mode for drawing text.

Namespace:  Microsoft.Graphics.Canvas.Text
Assembly:  Microsoft.Graphics.Canvas (in Microsoft.Graphics.Canvas.dll) Version: 0.0.0.0
Syntax
C#
public enum CanvasTextAntialiasing
Members
  Member nameValueDescription
Auto0Automatically choose the text antialiasing mode.
ClearType1Use ClearType antialiasing.
Grayscale2Use grayscale antialiasing.
Aliased3Do not use antialiasing.
Remarks

In most cases, Grayscale is a better choice than the Auto algorithm. Auto mode selects ClearType antialiasing unless:

  • The output rendertarget has an alpha channel and is not set to Ignore, in which case Grayscale mode is used.
  • There is a current CanvasActiveLayer, in which case Grayscale mode is used.
  • A DWrite rendering mode has been explicitly set on the output rendertarget (via D2D interop, as that functionality is not currently available in Win2D), in which case the DWrite mode determines text antialiasing behavior.

Drawing ClearType directly to a transparent background, while not an error, can produce undefined results. If your app needs to draw ClearType text to a transparent background, consider using a CanvasActiveLayer followed by a Clear to an opaque color, or using FillRectangle Overload to fill an opaque rectangle behind the text.

See Also