UDF > GDIPlus > StringFormat >


_GDIPlus_StringFormatSetLineAlign

Définit l'alignement vertical de ligne d'un objet StringFormat par rapport à l'origine d'un rectangle de mise en page

#include <GDIPlus.au3>
_GDIPlus_StringFormatSetLineAlign ( $hStringFormat, $iStringAlign )

Paramètres

$hStringFormat Handle de l'objet StringFormat
$iStringAlign Type d'alignement de ligne à utiliser:
    0 - Alignement vertical à l'origine du rectangle délimitant
    1 - Centré entre l'origine et la hauteur du rectangle de mise en forme
    2 - Alignement aussi bas que possible (coté droit) du rectangle de mise en forme

Valeur de retour

Succès: Retourne True.
Échec: Retourne False et définit @error <> 0, @extended contient le code erreur GPSTATUS ($GPID_ERR*).

Remarque

Le réglage de l'alignement de ligne indique comment aligner verticalement la chaîne dans le rectangle de mise en page.
La disposition du rectangle est utilisée pour positionner la chaîne affichée.

En relation

_GDIPlus_StringFormatSetAlign

Voir aussi

Consultez GdipSetStringFormatLineAlign dans la Librairie MSDN.

Exemple

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

Example()

Func Example()
    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_StringFormatSetLineAlign($hStringFormat, 1)
    _GDIPlus_GraphicsDrawStringEx($hGraphics, "AutoIt Rocks", $hFont, $hLayout, $hStringFormat, $hBrush)

    Do
        Local $iMsg = GUIGetMsg()
    Until $iMsg = $GUI_EVENT_CLOSE

    _GDIPlus_BrushDispose($hBrush)
    _GDIPlus_FontFamilyDispose($hFamily)
    _GDIPlus_FontDispose($hFont)
    _GDIPlus_StringFormatDispose($hStringFormat)
    _GDIPlus_GraphicsDispose($hGraphics)
    _GDIPlus_Shutdown()
EndFunc   ;==>Example