Function Reference


_GDIPlus_GraphicsSetTextRenderingHint

Sets the contrast value of a Graphics object

#include <GDIPlus.au3>
_GDIPlus_GraphicsSetTextRenderingHint ( $hGraphics, $iTextRenderingHint )

Parameters

$hGraphics Pointer to a Graphics object
$iTextRenderingHint Text rendering mode:
    0 - Character is drawn using the currently selected system font smoothing mode (also called a rendering hint)
    1 - Character is drawn using its glyph bitmap and hinting to improve character appearance on stems and
    2 - Character is drawn using its glyph bitmap and no hinting. This results in better performance at the
    3 - Character is drawn using its antialiased glyph bitmap and hinting. This results in much better quality
    4 - Character is drawn using its antialiased glyph bitmap and no hinting. Stem width differences may be
    5 - Character is drawn using its glyph Microsoft ClearType bitmap and hinting. This type of text rendering

Return Value

Success: True.
Failure: False and sets the @error flag to non-zero, @extended may contain GPSTATUS error code ($GPID_ERR*).

See Also

Search GdipSetTextRenderingHint in MSDN Library.

Example

#include <GDIPlus.au3>
#include <GUIConstantsEx.au3>
#include <MsgBoxConstants.au3>

Example()

Func Example()
    Local $hGUI = GUICreate("GDI+ test", 800, 400)
    GUISetState(@SW_SHOW)

    If @OSBuild < 6000 Then MsgBox($MB_SYSTEMMODAL, "", "Antialiasing is automatically turned on for your operating system - no visible differences!")

    _GDIPlus_Startup()
    Local $hGraphics = _GDIPlus_GraphicsCreateFromHWND($hGUI)
    _GDIPlus_GraphicsDrawString($hGraphics, "AutoIt rulez!", 0, 0, "Impact", 110)
    _GDIPlus_GraphicsSetTextRenderingHint($hGraphics, $GDIP_TEXTRENDERINGHINT_ANTIALIASGRIDFIT)
    _GDIPlus_GraphicsDrawString($hGraphics, "AutoIt rulez!", 0, 200, "Impact", 110)

    While 1
        Switch GUIGetMsg()
            Case $GUI_EVENT_CLOSE
                ExitLoop
        EndSwitch
    WEnd

    ;cleanup resources
    _GDIPlus_GraphicsDispose($hGraphics)
    _GDIPlus_Shutdown()
    GUIDelete($hGUI)
EndFunc   ;==>Example