Setzt die Zeilenausrichtung eines StringFormat-Objektes in Relation zu dem Ursprung des Layout-Rechtecks
#include <GDIPlus.au3>
_GDIPlus_StringFormatSetLineAlign ( $hStringFormat, $iStringAlign )
$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 |
Erfolg: | True. |
Fehler: | False und setzt das @error Flag auf ungleich null. @extended kann den GPSTATUS Fehlercode ($GPID_ERR* siehe GDIPlusConstants.au3) enthalten. |
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.
Suche nach GdipSetStringFormatLineAlign in der MSDN Bibliothek.
#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