Définit la justification du texte d'un objet StringFormat
#include <GDIPlus.au3>
_GDIPlus_StringFormatSetAlign ( $hStringFormat, $iFlag )
$hStringFormat | Handle de l'objet StringFormat |
$iFlag | La justification peut être l'une des suivantes: 0 - Le texte est justifié à gauche 1 - Le texte est centré 2 - Le texte est jstifié à droite |
Succès: | Retourne True. |
Échec: | Retourne False et définit @error <> 0, @extended contient le code erreur GPSTATUS ($GPID_ERR*). |
Consultez GdipSetStringFormatAlign dans la Librairie MSDN.
#include <GDIPlus.au3> #include <GUIConstantsEx.au3> Local $hWnd = GUICreate("GDI+ Example", 400, 300) GUISetState(@SW_SHOW) _GDIPlus_Startup() Local $hGraphics = _GDIPlus_GraphicsCreateFromHWND($hWnd) _GDIPlus_GraphicsClear($hGraphics) Local $hBrush = _GDIPlus_BrushCreateSolid(0xFF009900) Local $hFamily = _GDIPlus_FontFamilyCreate("Arial") Local $hFont = _GDIPlus_FontCreate($hFamily, 36) Local $hLayout = _GDIPlus_RectFCreate(0, 0, 400, 300) Local $hStringFormat = _GDIPlus_StringFormatCreate() _GDIPlus_StringFormatSetAlign($hStringFormat, 1) _GDIPlus_GraphicsDrawStringEx($hGraphics, "AutoIt Rocks", $hFont, $hLayout, $hStringFormat, $hBrush) Local $iMsg = 0 Do $iMsg = GUIGetMsg() Until $iMsg = $GUI_EVENT_CLOSE _GDIPlus_BrushDispose($hBrush) _GDIPlus_FontFamilyDispose($hFamily) _GDIPlus_FontDispose($hFont) _GDIPlus_StringFormatDispose($hStringFormat) _GDIPlus_GraphicsDispose($hGraphics) _GDIPlus_Shutdown()