Graphics::SetSmoothingMode method (gdiplusgraphics.h)

The Graphics::SetSmoothingMode method sets the rendering quality of the Graphics object.

Syntax

Status SetSmoothingMode(
  [in] SmoothingMode smoothingMode
);

Parameters

[in] smoothingMode

Type: SmoothingMode

Element of the SmoothingMode enumeration that specifies whether smoothing (antialiasing) is applied to lines and curves.

Return value

Type: Status

If the method succeeds, it returns Ok, which is an element of the Status enumeration.

If the method fails, it returns one of the other elements of the Status enumeration.

Remarks

To get the rendering quality for text, use the Graphics::GetTextRenderingHint method. The higher the level of quality of the smoothing mode, the slower the performance.

Examples

The following example sets the smoothing mode to two different values and fills an ellipse to demonstrate each mode.

VOID Example_SetSetSmoothingMode(HDC hdc)
{
   Graphics graphics(hdc);

   // Set the smoothing mode to SmoothingModeHighSpeed, and fill an ellipse.
   graphics.SetSmoothingMode(SmoothingModeHighSpeed);
   graphics.FillEllipse(&SolidBrush(Color(255, 0, 0, 0)), 0, 0, 200, 100);

   // Set the smoothing mode to SmoothingModeHighQuality, and fill an ellipse.
   graphics.SetSmoothingMode(SmoothingModeHighQuality);
   graphics.FillEllipse(&SolidBrush(Color(255, 0, 0, 0)), 200, 0, 200, 100);
}

Requirements

Requirement Value
Minimum supported client Windows XP, Windows 2000 Professional [desktop apps only]
Minimum supported server Windows 2000 Server [desktop apps only]
Target Platform Windows
Header gdiplusgraphics.h (include Gdiplus.h)
Library Gdiplus.lib
DLL Gdiplus.dll

See also

Antialiasing with Lines and Curves

Graphics

Graphics::GetSmoothingMode

Loading and Displaying Bitmaps