Share via


Graphics::GetSmoothingMode 方法 (gdiplusgraphics.h)

Graphics::GetSmoothingMode 方法會判斷是否將平滑化 (反鋸齒) 套用至 Graphics 物件。

Syntax

SmoothingMode GetSmoothingMode();

傳回值

類型: SmoothingMode

如果將平滑 (反鋸齒) 套用至此 Graphics 對象,這個方法會傳回 SmoothingModeAntiAlias。 如果未將平滑化 (反鋸齒) 套用至此 Graphics 物件,此方法會傳回 SmoothingModeNone。 SmoothingModeAntiAlias 和 SmoothingModeNone 是 SmoothingMode 列舉的元素。

備註

若要取得文字的轉譯質量等級,請使用 Graphics::GetTextRenderingHint 方法。

範例

下列範例會將平滑模式設定為高速,並繪製橢圓形。 然後,它會取得平滑模式、將其變更為高品質,並繪製第二個省略號來示範差異。

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));
}

規格需求

需求
最低支援的用戶端 Windows XP、Windows 2000 Professional [僅限桌面應用程式]
最低支援的伺服器 Windows 2000 Server [僅限桌面應用程式]
目標平台 Windows
標頭 gdiplusgraphics.h (包含 Gdiplus.h)
程式庫 Gdiplus.lib
Dll Gdiplus.dll

另請參閱

線條和曲線的反鋸齒功能

圖形

映像

載入和顯示點陣圖