Hallo Community
Ich habe ein Problem mit Gdi+.Ich habe gestern mal angefangen mich einzuarbeiten ,aber dann bin ich auf ein Problem gestoßen.
Ich bekomme den Text nicht aufs Fenster.Der Fehler liegt in Zeile 17 ,aber ich finde die richtigen Koordinaten nicht.
Wenns jemand packt bitte dazu schreiben wie er die Richtigen rausbekommen hat.
#include <GuiConstantsEx.au3>
#include <GDIPlus.au3>
#include <WindowsConstants.au3>
; Erstellt eine GUI
$Form1_1 = GUICreate("gdi fun",297, 121, 464, 451,$WS_POPUPWINDOW)
;GUISetBkColor($form1_1,0x000000);schwarz
$hwnd=wingethandle($form1_1)
GUISetState(@SW_DISABLE)
; Zeichnet einen String
_GDIPlus_Startup ()
$hGraphic = _GDIPlus_GraphicsCreateFromHWND ($hWnd)
$hBrush = _GDIPlus_BrushCreateSolid (0x800000);rot
$hFormat = _GDIPlus_StringFormatCreate ()
$hFamily = _GDIPlus_FontFamilyCreate ("Arial")
$hFont = _GDIPlus_FontCreate ($hFamily, 12, 2)
$tLayout = _GDIPlus_RectFCreate (140,80,20,80);<--- hier raten das der text angezeigt wird
_GDIPlus_GraphicsDrawStringEx ($hGraphic, "TEST", $hFont,$tLayout , $hFormat, $hBrush)
GUISetState(@SW_SHOW,$form1_1)
for $i = 1 to 255
winsettrans($form1_1,"",$i)
sleep(2)
next
; 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 ()