Erstellt ein Schrift-Objekt
#include <GDIPlus.au3>
_GDIPlus_FontCreate($hFamily, $fSize [, $iStyle = 0 [, $iUnit = 3]])
| $hFamily | Handle zu einem Schrift-Familien-Objekt |
| $fSize | Die Größe der Schrift, gemessen in der Einheit die in $iUnit angegeben wurde |
| $iStyle | [optional] Der Stil des Schriftstils. Kann eine Kombination der folgenden sein: 0 - normale Dicke der Schriftart 1 - "Fett" 2 - "Kursiv" 4 - "Unterstrichen" 8 - "Durchgestrichen" |
| $iUnit | [optional] Maßeinheit der Schriftgröße: 0 - Weltkoordinaten, eine nichtphysikalische Einheit 1 - Anzeigeeinheiten 2 - Eine Einheit ist 1 Pixel 3 - Eine Einheit ist 1 Punkt oder 1/72 Inch 4 - Eine Einheit ist 1 Inch 5 - Eine Einheit ist 1/300 Inch 6 - Eine Einheit ist 1 Millimeter |
| Erfolg: | Handle zu einem Schrift-Objekt |
| Fehler: | 0 |
#include <GuiConstantsEx.au3>
#include <GDIPlus.au3>
_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(0x7F00007F)
$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