Graphics::SetSmoothingMode method (gdiplusgraphics.h)

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


Status SetSmoothingMode(
  [in] SmoothingMode smoothingMode


[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.


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.


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.FillEllipse(&SolidBrush(Color(255, 0, 0, 0)), 0, 0, 200, 100);

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


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



Loading and Displaying Bitmaps