Probiere es mal damit:
Spoiler anzeigen
#include <Array.au3>
#include <GUIConstantsEx.au3>
#include <gdiplus.au3>
#include <misc.au3>
_GDIPlus_Startup()
$hImage = _GDIPlus_ImageLoadFromFile(FileOpenDialog("Bild auswählen", @ScriptDir, "Bilder (*.jpg)"))
If Not $hImage Then Exit _GDIPlus_Shutdown()
$x = 140
$y = 110
$iW = 625
$iH = 443
$Form1 = GUICreate("Form1", $iW, $iH)
GUISetState()
$aFont = _ChooseFont()
[/autoit] [autoit][/autoit] [autoit]$Text = "Das ist Text 1" & @LF & _
"Das ist Text 2" & @LF & _
"Das ist Text 3"
$hGraphics = _GDIPlus_GraphicsCreateFromHWND($form1)
$hBitmap = _GDIPlus_BitmapCreateFromGraphics($iW, $iH, $hGraphics)
$hCtxt = _GDIPlus_ImageGetGraphicsContext($hBitmap)
_GDIPlus_GraphicsSetSmoothingMode($hCtxt, 2)
DllCall($ghGDIPDll, "uint", "GdipSetTextRenderingHint", "handle", $hCtxt, "int", 4)
_GDIPlus_GraphicsDrawImage($hCtxt, $hImage, 0, 0)
$hBrush = _GDIPlus_BrushCreateSolid(0xFF000000 + $aFont[7])
$hFormat = _GDIPlus_StringFormatCreate()
$hFamily = _GDIPlus_FontFamilyCreate($aFont[2])
$hFont = _GDIPlus_FontCreate($hFamily, $aFont[3], $aFont[1])
$tLayout = _GDIPlus_RectFCreate($x, $y, 1000, 1000)
_GDIPlus_GraphicsDrawStringEx($hCtxt, $Text, $hFont, $tLayout, $hFormat, $hBrush)
_GDIPlus_GraphicsDrawImage($hGraphics, $hBitmap, 0, 0)
Global $hDLL = DllOpen("user32.dll")
[/autoit] [autoit][/autoit] [autoit]While 1
Switch GUIGetMsg()
Case $GUI_EVENT_CLOSE
_GDIPlus_ImageSaveToFile($hBitmap, @ScriptDir & "\Ilse.jpg")
_GDIPlus_FontDispose($hFont)
_GDIPlus_FontFamilyDispose($hFamily)
_GDIPlus_StringFormatDispose($hFormat)
_GDIPlus_BrushDispose($hBrush)
_GDIPlus_GraphicsDispose($hGraphics)
_GDIPlus_GraphicsDispose($hCtxt)
_GDIPlus_Shutdown()
DllClose($hDLL)
GUIDelete()
Exit
EndSwitch
If _IsPressed("25") Then
$x -= 1
DllStructSetData($tLayout, "X", $x)
Update()
ElseIf _IsPressed("27") Then
$x += 1
DllStructSetData($tLayout, "X", $x)
Update()
ElseIf _IsPressed("26") Then
$y -= 1
DllStructSetData($tLayout, "Y", $y)
Update()
ElseIf _IsPressed("28") Then
$y += 1
DllStructSetData($tLayout, "Y", $y)
Update()
EndIf
WEnd
Func Update()
_GDIPlus_GraphicsDrawImage($hCtxt, $hImage, 0, 0)
_GDIPlus_GraphicsDrawStringEx($hCtxt, $Text, $hFont, $tLayout, $hFormat, $hBrush)
_GDIPlus_GraphicsDrawImage($hGraphics, $hBitmap, 0, 0)
Return 1
EndFunc
Gruß,
UEZ