본문 바로가기

Windows/MFC

[GDI+] 이미지에 Anti-aliasing (안티 알라이싱) 주기

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

Syntax

Status SetSmoothingMode(         SmoothingMode smoothingMode
);
Parameters

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


[code]
g.SetSmoothingMode(SmoothingModeAntiAlias);
[/code]

SmoothingMode Enumerated Type
SmoothingModeInvalid
    Reserved.

SmoothingModeDefault
    Specifies that smoothing is not applied.

SmoothingModeHighSpeed
    Specifies that smoothing is not applied.

SmoothingModeHighQuality
    Specifies that smoothing is applied using an 8 X 4 box filter.

SmoothingModeNone
    Specifies that smoothing is not applied.

SmoothingModeAntiAlias8x4
    Specifies that smoothing is applied using an 8 X 4 box filter.

SmoothingModeAntiAlias
    Specifies that smoothing is applied using an 8 X 4 box filter.

SmoothingModeAntiAlias8x8
    Specifies that smoothing is applied using an 8 X 8 box filter.


[code]MSDN Example
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);
}
[/code]


'Windows > MFC' 카테고리의 다른 글

VS2005 reset user switch  (0) 2013.10.02
Step by Step: Migrating an eMbedded Visual C++ Application to Visual Studio 2005  (0) 2013.10.02
[GDI+] RoundRect  (0) 2013.10.02
MulDiv  (0) 2013.10.02
GetSystemMetrics  (0) 2013.10.02