Sets the contrast value of a Graphics object
#include <GDIPlus.au3>
_GDIPlus_GraphicsSetTextRenderingHint ( $hGraphics, $iTextRenderingHint )
$hGraphics | Pointer to a Graphics object |
$iTextRenderingHint | Text rendering mode: $GDIP_TEXTRENDERINGHINTSYSTEMDEFAULT (0) - Character is drawn using the currently selected system font smoothing mode (also called a rendering hint). $GDIP_TEXTRENDERINGHINTSINGLEBITPERPIXELGRIDFIT (1) - Character is drawn using its glyph bitmap and hinting to improve character appearance on stems and curvature. $GDIP_TEXTRENDERINGHINTSINGLEBITPERPIXEL (2) - Character is drawn using its glyph bitmap and no hinting. This results in better performance at the expense of quality. $GDIP_TEXTRENDERINGHINTANTIALIASGRIDFIT (3) - Character is drawn using its antialiased glyph bitmap and hinting. This results in much better quality due to antialiasing at a higher performance cost. $GDIP_TEXTRENDERINGHINTANTIALIAS (4) - Character is drawn using its antialiased glyph bitmap and no hinting. Stem width differences may be noticeable because hinting is turned off. $GDIP_TEXTRENDERINGHINTCLEARTYPEGRIDFIT (5) - Character is drawn using its glyph Microsoft ClearType bitmap and hinting. This type of text rendering cannot be used along with $GDIP_COMPOSITINGMODESOURCECOPY. |
Success: | True. |
Failure: | False and sets the @error flag to non-zero, @extended may contain GPSTATUS error code ($GPIP_ERR* see GPIPlusConstants.au3). |
Search GdipSetTextRenderingHint in MSDN Library.
#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_TEXTRENDERINGHINTANTIALIASGRIDFIT)
_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