Erstellt ein String-Format-Objekt
#Include <GDIPlus.au3>
_GDIPlus_StringFormatCreate([$iFormat = 0[, $iLangID = 0]])
Parameter
| $iFormat | [optional] Format Flags. Können ein oder mehrere der folgenden sein: 0x0001 - Gibt an, dass die Reihenfolge des Lesens von rechts nach links ist. 0x0002 - Legt fest, dass einzelne Textzeilen vertikal auf das Display gezeichnet werden. 0x0004 - Gibt an, dass Teile von Zeichen erlaubt sind um das Rechteck-Layout des strings zu überragen 0x0020 - Gibt an, dass das Unicode-Layout Kontrollelement mit einem vertretenden Zeichen angezeigt wird. 0x0400 - Gibt an, dass für Zeichen, die in der gewünschten Schriftart nicht unterstützt werden eine alternative Schriftart benutzt wird. 0x0800 - Gibt an, dass die Leerzeichen am Ende jeder Zeile in einen String-Messwert eingebunden werden. 0x1000 - Gibt an, dass der Umbruch des Textes auf die nächste Zeile deaktiviert ist. 0x2000 - Gibt an, dass nur ganze Zeilen in das Layout-Rechteck gelegt werden 0x4000 - Gibt an, dass Zeichen die das Layout-Rechteck überragen und Text der über das Ende des Layout-Rechtecks hinausschaut angezeigt werden darf. |
| $iLangID | [optional] Die Sprache die benutzt werden soll. |
Rückgabewert
| Erfolg: | Handle auf ein String-Format-Objekt |
| Fehler: | 0 |
Bemerkungen
Wenn man fertig ist mit dem String-Format, sollte man zur Freigabe der Ressourcen _GDIPlus_StringFormatDispose aufrufen.
Verwandte Funktionen
_GDIPlus_StringFormatDispose, _GDIPlus_StringFormatSetAlign
Siehe auch
Suche in der MSDN Bibliothek nach GdipCreateStringFormat
Beispiel
#include <GuiConstantsEx.au3>
#include <GDIPlus.au3>
Opt('MustDeclareVars', 1)
_Main()
Func _Main()
Local $hGUI, $hGraphic, $hBrush, $hFormat, $hFamily, $hFont, $tLayout
; Erstellt eine GUI
$hGUI = GUICreate("GDI+", 400, 300)
GUISetState()
; Zeichnet einen String
_GDIPlus_Startup ()
$hGraphic = _GDIPlus_GraphicsCreateFromHWND ($hGUI)
$hBrush = _GDIPlus_BrushCreateSolid (0xFF00007F)
$hFormat = _GDIPlus_StringFormatCreate ()
$hFamily = _GDIPlus_FontFamilyCreate ("Arial")
$hFont = _GDIPlus_FontCreate ($hFamily, 12, 2)
$tLayout = _GDIPlus_RectFCreate (140, 110, 100, 20)
_GDIPlus_GraphicsDrawStringEx ($hGraphic, "Hallo Welt!", $hFont, $tLayout, $hFormat, $hBrush)
; Die Schleife wiederholt sich, bis der Benutzer die Beenden-Aktion der GUI auslöst
Do
Until GUIGetMsg() = $GUI_EVENT_CLOSE
; Ressourcen freigeben
_GDIPlus_FontDispose ($hFont)
_GDIPlus_FontFamilyDispose ($hFamily)
_GDIPlus_StringFormatDispose ($hFormat)
_GDIPlus_BrushDispose ($hBrush)
_GDIPlus_GraphicsDispose ($hGraphic)
_GDIPlus_ShutDown ()
EndFunc ;==>_Main