Funktionreferenz


_GDIPlus_StringFormatSetLineAlign

Beschreibung anzeigen in

Setzt die Zeilenausrichtung eines StringFormat-Objektes in Relation zu dem Ursprung des Layout-Rechtecks

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

Parameter

$hStringFormat Ein Zeiger zu einem StringFormat-Objekt
$iStringAlign Der Typ der zu verwendenden Zeilenausrichtung:
    0 - Die Ausrichtung ist zum Ursprung des Bounding-Rechtecks
    1 - Die Ausrichtung wird zwischen Ursprung und der Höhe des Formattierungsrechtecks zentriert
    2 - Die Ausrichtung ist weit außen (rechte Seite) des Formattierungsrechtecks

Rückgabewert

Erfolg: True.
Fehler: False und setzt das @error Flag auf ungleich 0. @extended kann den GPSTATUS Fehlercode ($GDIP_ERR* siehe GPIPlusConstants.au3) enthalten.

Bemerkungen

Die Zeilenausrichtung gibt an wie die Strings vertikal im Layout-Rechteck angeordnet werden sollen.
Das Layout-Rechteck wird verwendet um den angezeigten String zu positionieren.

Verwandte Funktionen

_GDIPlus_StringFormatSetAlign

Siehe auch

Suche nach GdipSetStringFormatLineAlign in der MSDN Bibliothek.

Beispiel

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

Example()

Func Example()
    Local $hWnd = GUICreate("GDI+ Beispiel (" & @ScriptName & ")", 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