Hallo,
ich habe auf einem Bild 2 Labels, wo oben Daten angegeben werden können und die Labels sich dann verändern, also der Inhalt der Labels halt.
Nun, die Labels verschwinden einfach ..
Wie kann ich das Problem lösen?
Skript :
Spoiler anzeigen
#include <ButtonConstants.au3>
#include <ComboConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <GDIPlus.au3>
_GDIPlus_Startup()
$Form1 = GUICreate("Form1", 578, 328, 192, 124)
$Pic1 = GUICtrlCreatePic("", 40, 120, 500, 200)
GuiCtrlSetState(-1,$GUI_DISABLE)
$Pic2 = GUICtrlCreatePic("", 40, 120, 180, 200)
GuiCtrlSetState(-1,$GUI_DISABLE)
$Input3 = GUICtrlCreateInput("", 304, 48, 257, 21)
$speichern = GUICtrlCreateButton("speichern", 232, 80, 75, 25)
$Namaa = GUICtrlCreateLabel("Namaa", 240, 144, 57, 20)
GUICtrlSetFont(-1, 12, 400, 0, "Cracked Johnnie")
GuiCtrlSetState(-1,$GUI_HIDE)
$Label1 = GUICtrlCreateLabel("Namaa", 239, 189, 57, 20)
GUICtrlSetFont(-1, 12, 400, 0, "Cracked Johnnie")
GuiCtrlSetState(-1,$GUI_HIDE)
$Label2 = GUICtrlCreateLabel("Namaa", 239, 225, 57, 20)
GUICtrlSetFont(-1, 12, 400, 0, "Cracked Johnnie")
GuiCtrlSetState(-1,$GUI_HIDE)
$Label3 = GUICtrlCreateLabel("Namaa", 235, 258, 57, 20)
GUICtrlSetFont(-1, 12, 400, 0, "Cracked Johnnie")
GuiCtrlSetState(-1,$GUI_HIDE)
GUISetState(@SW_SHOW)
GuiCtrlSetState($Label1,$GUI_SHOW)
GuiCtrlSetState($Label2,$GUI_SHOW)
GuiCtrlSetState($Label3,$GUI_SHOW)
GuiCtrlSetState($Namaa,$GUI_SHOW)
GuiCtrlSetState($Pic1,$GUI_ENABLE)
GuiCtrlSetState($Pic2,$GUI_ENABLE)
DisplayImage($Pic1,@ScriptDir & "\Hintergrund.png")
DisplayImage($Pic2,@ScriptDir & "\SecondImage.png")
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
_GDIPlus_Shutdown()
Exit
EndSwitch
WEnd
Func DisplayImage($id, $file)
Local Const $IMAGE_BITMAP = 0
Local Const $STM_SETIMAGE = 0x0172
Local $hImage = _GDIPlus_ImageLoadFromFile($file)
If @error Then Return SetError(1, 0, 0)
$aPos = ControlGetPos("", "", $id)
If @error Then Return SetError(2, 0, 0)
Local Const $aResult = DllCall($ghGDIPDll, "uint", "GdipCreateBitmapFromScan0", "int", $aPos[2], "int", $aPos[3], "int", 0, "int", 0x0026200A, "ptr", 0, "int*", 0)
Local Const $hBitmap = $aResult[6]
Local Const $hCtxt = _GDIPlus_ImageGetGraphicsContext($hBitmap)
DllCall($ghGDIPDll, "uint", "GdipSetInterpolationMode", "handle", $hCtxt, "int", 7)
_GDIPlus_GraphicsDrawImageRect($hCtxt, $hImage, 0, 0, $aPos[2], $aPos[3])
Local $hHBitmap = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hBitmap)
_GDIPlus_ImageDispose($hImage)
_GDIPlus_BitmapDispose($hBitmap)
_GDIPlus_GraphicsDispose($hCtxt)
_WinAPI_DeleteObject(GUICtrlSendMsg($id, $STM_SETIMAGE, $IMAGE_BITMAP, $hHBitmap))
_WinAPI_DeleteObject($hHBitmap)
EndFunc