Requires: Direct2D.lg32
Sets the antialiasing mode for subsequent figure and/or text drawing.
D2AntiAliasing fOn? [,What]
fOn? | : Boolean |
What | : iexp |
D2AntiAliasing disables (fOn = False) or enables (fOn = True) the antialiasing mode for the current render target. By default, the render target uses antialiasing for drawing figures, text, bitmaps and clipping. By setting the fOn? parameter to False all antialiasing is disabled. The application can use the What parameter to distinguish between the antialiasing of the drawing of figures (including bitmap and clipping) drawing and text drawing.
What | Description |
---|---|
D2AA_FIGURES (1) | Figures and bitmap drawing; clipping rectangle |
D2AA_TEXT(2) | Text drawing |
These values can be combined. By default What is set to D2AA_FIGURES | D2AA_TEXT.
'
' D2AntiAlising
'
$Library "direct2d"
Global Object Win1RT
OpenW 1, 0, 0, 320, 260, ~15
' DC Rendertarget same size as clientarea
Set Win1RT = D2GetRT()
Do
Sleep
Until Me Is Nothing
Sub Win_1_Paint
D2BeginDraw Win1RT, D2C_White
D2Circle 50, 50, 40
D2Text 10, 100, "AntiAliased"
D2AntiAlias False
D2Circle 150, 50, 40
D2Text 110, 100, "Not AntiAliased"
D2AntiAlias True
D2EndDraw
EndSub
D2AntiAliasing invokes ID2D1RenderTarget::SetAntialiasMode and/or ID2D1RenderTarget::SetTextAntialiasMode. The D2Put and D2Clip commands obtain and use the current antialias mode from ID2D1RenderTarget::GetAntialiasMode to execute their Direct2D rendertarget methods.
{Created by Sjouke Hamstra; Last updated: 12/03/2021 by James Gaite}