GetSmoothingMode
TOC
Collapse the table of content
Expand the table of content

Graphics.GetSmoothingMode method

Applies to: desktop apps only

The Graphics::GetSmoothingMode method determines whether smoothing (antialiasing) is applied to the Graphics object.

Syntax

SmoothingMode GetSmoothingMode() const;

Parameters

This method has no parameters.

Return value

Type:

Type: SmoothingMode

If smoothing (antialiasing) is applied to this Graphics object, this method returns SmoothingModeAntiAlias. If smoothing (antialiasing) is not applied to this Graphics object, this method returns SmoothingModeNone. SmoothingModeAntiAlias and SmoothingModeNone are elements of the SmoothingMode enumeration.

Remarks

To get the rendering quality level for text, use the Graphics::GetTextRenderingHint method.

Examples

The following example sets the smoothing mode to high speed and draws an ellipse. It then gets the smoothing mode, changes it to high quality, and draws a second ellipse to demonstrate the difference.


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

   // Set the smoothing mode to SmoothingModeHighSpeed.
   graphics.SetSmoothingMode(SmoothingModeHighSpeed);

   // Draw an ellipse.
   graphics.DrawEllipse(&Pen(Color(255, 0, 0, 0), 3), Rect(10, 0, 200, 100));

   // Get the smoothing mode.
   SmoothingMode mode = graphics.GetSmoothingMode();


   // Test mode to see whether smoothing has been set for the Graphics object.
   if (mode == SmoothingModeAntiAlias)
   {
   graphics.SetSmoothingMode(SmoothingModeHighQuality);
   }

   // Draw an ellipse to demonstrate the difference.
   graphics.DrawEllipse(&Pen(Color::Red, 3), Rect(220, 0, 200, 100));
}

Requirements

Minimum supported client

Windows XP, Windows 2000 Professional

Minimum supported server

Windows 2000 Server

Product

GDI+ 1.0

Header

Gdiplusgraphics.h (include Gdiplus.h)

Library

Gdiplus.lib

DLL

Gdiplus.dll

See also

Graphics
Image
Loading and Displaying Bitmaps
Antialiasing with Lines and Curves

 

 

Send comments about this topic to Microsoft

Build date: 3/6/2012

Community Additions

ADD
Show:
© 2016 Microsoft