Hier ein Beispiel. Schaut aber nicht schön aus, finde ich...
Spoiler anzeigen
#include <GDIPlus.au3>
[/autoit] [autoit][/autoit] [autoit]Opt('MustDeclareVars', 1)
Opt('GUIOnEventMode', 1)
_GDIPlus_Startup()
Global $i_WIDTH = 400, $i_HEIGHT = 300
Global $h_GUI, $h_Graphic
$h_GUI = GUICreate('', $i_WIDTH, $i_HEIGHT)
$h_Graphic = _GDIPlus_GraphicsCreateFromHWND($h_GUI)
GUISetOnEvent(-3, '_Exit', $h_GUI)
GUISetState(@SW_SHOW, $h_GUI)
While True
For $i = 10 To 70
_GDIPlus_GraphicsClear($h_Graphic, 0xFFFFFFFF)
_GDIPlus_GraphicsDrawStringCustom($h_Graphic, '$var', $i_WIDTH / 2, 100, $i, 0xFF000000, 1, 0, 'Tahoma')
Sleep(50)
Next
WEnd
Func _Exit()
_GDIPlus_GraphicsDispose($h_Graphic)
_GDIPlus_Shutdown()
Exit
EndFunc
; #FUNCTION# ===================================================================
; Name ..........: _GDIPlus_GraphicsDrawStringCustom
; Description ...: Draw a customized string
; AutoIt Version : v3.3.6.1
; Syntax ........: _GDIPlus_GraphicsDrawStringCustom ($h_Graphics, $s_String, $n_X, $n_Y, $n_Size, $b_Color[, $i_Align = 0[, $i_Weight = 0[, $s_Font = 'Arial']]])
; Parameter(s): .: $h_Graphics - Handle to a Graphics object
; $s_String - String to be drawn
; $n_X - X coordinate where the string will be drawn
; $n_Y - Y coordinate where the string will be drawn
; $n_Size - Font size to use for drawing
; $b_Color - Alpha, Red, Green and Blue components
; $i_Align - The alignment can be one of the following:
; |0 - The text is aligned to the left
; |1 - The text is centered
; |2 - The text is aligned to the right
; $i_Weight - The style of the typeface. Can be a combination of the following:
; |0 - Normal weight or thickness of the typeface
; |1 - Bold typeface
; |2 - Italic typeface
; |4 - Underline
; |8 - Strikethrough
; $s_Font - Name of the Font Family
; Return Value ..: Success - True
; Failure - False
; Author(s) .....: $var
; ==============================================================================
Func _GDIPlus_GraphicsDrawStringCustom ($h_Graphics, $s_String, $n_X, $n_Y, $n_Size, $b_Color, $i_Align = 0, $i_Weight = 0, $s_Font = 'Arial')
Local $a_CreateSolidFill, $a_CreateStringFormat, $a_CreateFontFamilyFromName, $a_CreateFont, $t_Struct, $p_Layout, $a_Return
$a_CreateSolidFill = DllCall ($ghGDIPDll, 'int', 'GdipCreateSolidFill', 'int', $b_Color, 'dword*', 0)
$a_CreateStringFormat = DllCall ($ghGDIPDll, 'int', 'GdipCreateStringFormat', 'int', 0, 'word', 0, 'ptr*', 0)
$a_CreateFontFamilyFromName = DllCall ($ghGDIPDll, 'int', 'GdipCreateFontFamilyFromName', 'wstr', $s_Font, 'ptr', 0, 'handle*', 0)
$a_CreateFont = DllCall ($ghGDIPDll, 'int', 'GdipCreateFont', 'handle', $a_CreateFontFamilyFromName[3], 'float', $n_Size, 'int', $i_Weight, 'int', 3, 'ptr*', 0)
$t_Struct = DllStructCreate ($tagGDIPRECTF)
$p_Layout = DllStructGetPtr ($t_Struct)
DllStructSetData ($t_Struct, 'X', $n_X)
DllStructSetData ($t_Struct, 'Y', $n_Y)
DllStructSetData ($t_Struct, 'Width', 0)
DllStructSetData ($t_Struct, 'Height', 0)
DllCall ($ghGDIPDll, 'int', 'GdipSetStringFormatAlign', 'handle', $a_CreateStringFormat[3], 'int', $i_Align)
$a_Return = DllCall ($ghGDIPDll, 'int', 'GdipDrawString', 'handle', $h_Graphics, 'wstr', $s_String, 'int', -1, 'handle', $a_CreateFont[5], _
'ptr', $p_Layout, 'handle', $a_CreateStringFormat[3], 'handle', $a_CreateSolidFill[2])
DllCall ($ghGDIPDll, 'int', 'GdipDeleteFont', 'handle', $a_CreateFont[5])
DllCall ($ghGDIPDll, 'int', 'GdipDeleteFontFamily', 'handle', $a_CreateFontFamilyFromName[3])
DllCall ($ghGDIPDll, 'int', 'GdipDeleteStringFormat', 'handle', $a_CreateStringFormat[3])
DllCall ($ghGDIPDll, 'int', 'GdipDeleteBrush', 'handle', $a_CreateSolidFill[2])
Return $a_Return[0] = 0
EndFunc ;==> _GDIPlus_GraphicsDrawStringCustom
Die Funktion in Zeile 18 kann natürlich auch durch die standard-Func _GDIPlus_GraphicsDrawString ersetzt werden.