hat einer von euch 2 vill. ICQ?
Dann könnte man schauen , wo das problem in
meinem Script liegt , dass das bild nicht gemalt wird
Edit:// :o ... Es lag an dem "local" in der funktion vor dem "$PNG_Extender_hPic = GUICtrlCreatePic("", $PNG_Extender_iY, $PNG_Extender_iX)"
Func GUICtrlCreatePng($PNG_Extender_hScreen, $PNG_Extender_iX = "", $PNG_Extender_iY = "")
$PNG_Extender_hPic = GUICtrlCreatePic("", $PNG_Extender_iY, $PNG_Extender_iX)
_GDIPlus_Startup()
Local $PNG_Extender_hImage = _GDIPlus_ImageLoadFromFile($PNG_Extender_hScreen)
Local $hBmp = _GDIPlus_BitmapCreateHBITMAPFromBitmap($PNG_Extender_hImage)
GUICtrlSendMsg($PNG_Extender_hPic, 0x0172, 0, $hBmp)
_WinAPI_DeleteObject($hBmp)
_GDIPlus_ImageDispose($PNG_Extender_hImage)
_GDIPlus_Shutdown()
Return $PNG_Extender_hPic
EndFunc ;==>GUICtrlCreatePng
So funktioniert es , danke
Edit2:// Doch nicht
Edit3:// Okay , hatte nach langen Google diese Funktion gefunden , die auch Funktioniert.
[autoit]Func GUICtrlCreatePng($hWnd, $sPath, $iX, $iY)
_GDIPlus_Startup()
Local $hScrDC, $hMemDC, $hBitmap, $hOld, $pSize, $tSize, $pSource, $tSource, $pBlend, $tBlend, $hGUI
Local $hImage = _GDIPlus_ImageLoadFromFile($sPath), $iWidth = _GDIPlus_ImageGetWidth($hImage), $iHeight = _GDIPlus_ImageGetHeight($hImage)
$hGUI = GUICreate("", $iWidth, $iHeight, $iX, $iY, 0x80000000, BitOR(0x40, 0x80000), $hWnd)
$cLabel = GUICtrlCreateLabel("", 0, 0, $iWidth, $iHeight)
GuiCtrlSetState (-1 , $GUI_DISABLE)
GUICtrlSetBkColor(-1, -2)
GUISetState(@SW_SHOWNOACTIVATE, $hGUI)
$hScrDC = _WinAPI_GetDC(0)
$hMemDC = _WinAPI_CreateCompatibleDC($hScrDC)
$hBitmap = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hImage)
$hOld = _WinAPI_SelectObject($hMemDC, $hBitmap)
$tSize = DllStructCreate("int X;int Y")
$pSize = DllStructGetPtr($tSize)
DllStructSetData($tSize, "X", $iWidth)
DllStructSetData($tSize, "Y", $iHeight)
$tSource = DllStructCreate("int X;int Y")
$pSource = DllStructGetPtr($tSource)
$tBlend = DllStructCreate("byte Op;byte Flags;byte Alpha;byte Format")
$pBlend = DllStructGetPtr($tBlend)
DllStructSetData($tBlend, "Alpha", 255)
DllStructSetData($tBlend, "Format", 1)
_WinAPI_UpdateLayeredWindow($hGUI, $hScrDC, 0, $pSize, $hMemDC, $pSource, 0, $pBlend, $ULW_ALPHA)
_WinAPI_ReleaseDC(0, $hScrDC)
_WinAPI_SelectObject($hMemDC, $hOld)
_WinAPI_DeleteObject($hBitmap)
_WinAPI_DeleteDC($hMemDC)
GUISwitch($hWnd)
_GDIPlus_ImageDispose($hImage)
_GDIPlus_Shutdown()
Return SetError(0,$hGUI,$cLabel)
EndFunc ;==>GUICtrlCreatePng