Damit der Text wie in dem Bild aussieht, benötigst du ein Font!
Hier ein GDI+ Text Beispiel:
Spoiler anzeigen
;coded by UEZ
#include <GuiConstantsEx.au3>
#include <GDIPlus.au3>
#include <Array.au3>
Opt('MustDeclareVars', 1)
[/autoit] [autoit][/autoit] [autoit]Global $hGUI, $hWnd, $hGraphic, $hBrush, $hFormat, $hFamily, $hFont, $tLayout
Global $x, $y, $w, $h
Global $sString = "Hello world"
Global $width = 400
Global $heigh = 40
; Create GUI
$hWnd = GUICreate("GDI+", $width, $heigh)
GUISetState()
_Main()
[/autoit] [autoit][/autoit] [autoit]Func _Main()
[/autoit] [autoit][/autoit] [autoit]; Draw a string
_GDIPlus_Startup ()
$hGraphic = _GDIPlus_GraphicsCreateFromHWND ($hWnd)
$hBrush = _GDIPlus_BrushCreateSolid (0xFF00007F)
$hFormat = _GDIPlus_StringFormatCreate ()
$hFamily = _GDIPlus_FontFamilyCreate ("Arial")
$hFont = _GDIPlus_FontCreate ($hFamily, 12, 2)
Measure($sString)
$tLayout = _GDIPlus_RectFCreate (($width - $w) / 2, ($heigh - $h) / 2, 0, 0)
_GDIPlus_GraphicsDrawStringEx ($hGraphic, $sString, $hFont, $tLayout, $hFormat, $hBrush)
; Loop until user exits
Do
Until GUIGetMsg() = $GUI_EVENT_CLOSE
; Clean up resources
_GDIPlus_FontDispose ($hFont)
_GDIPlus_FontFamilyDispose ($hFamily)
_GDIPlus_StringFormatDispose ($hFormat)
_GDIPlus_BrushDispose ($hBrush)
_GDIPlus_GraphicsDispose ($hGraphic)
_GDIPlus_Shutdown ()
EndFunc ;==>_Main
[/autoit] [autoit][/autoit] [autoit]Func Measure($text)
Local $hBuffer = _GDIPlus_GraphicsCreateFromHWND ($hWnd)
Local $hBrush = _GDIPlus_BrushCreateSolid (0xFF00007F)
Local $hFormat = _GDIPlus_StringFormatCreate ()
Local $hFamily = _GDIPlus_FontFamilyCreate ("Arial")
Local $hFont = _GDIPlus_FontCreate ($hFamily, 12, 2)
Local $tLayout = _GDIPlus_RectFCreate (0, 0, 0, 0)
Local $aInfo = _GDIPlus_GraphicsMeasureString ($hBuffer, $sString, $hFont, $tLayout, $hFormat)
$x = DllStructGetData($aInfo[0],1)
$y = DllStructGetData($aInfo[0],2)
$w = DllStructGetData($aInfo[0],3)
$h = DllStructGetData($aInfo[0],4)
ConsoleWrite("x: " & $x & @CRLF & "y: " & $y & @CRLF & "w: " & $w & @CRLF & "h: " & $h & @CRLF)
EndFunc
Willst du ein Font laden und in GDI+ benutzen, so schaue doch mal hier vorbei: http://www.autoitscript.com/forum/index.php?showtopic=94679&view=findpost&p=680168&hl=&fromsearch=1
Gruß,
UEZ
PS: ist ein älteres Beispiel!