Probiere es mal hier mit:
Spoiler anzeigen
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <GDIPlus.au3>
#Include <WinAPI.au3>
#include <GDIpProgress.au3>
Global $hGUI, $hImage, $hGraphic, $hImage
Global Const $SC_DRAGMOVE = 0xF012
Global $iImagePfad = @ScriptDir & "\", $i
_GDIPlus_StartUp()
; Load PNG image
$hImage = _GDIPlus_ImageLoadFromFile($iImagePfad & "bg.png")
$iWidth = _GDIPlus_ImageGetWidth($hImage)
$iHeight = _GDIPlus_ImageGetHeight($hImage)
ConsoleWrite($iWidth & " / " & $iHeight)
; Create GUI
$hGUI = GUICreate("Show PNG", $iWidth, $iHeight, 0,0, $WS_POPUP, $WS_EX_LAYERED + $WS_EX_TOPMOST)
$hGUI_child = GUICreate("", $iWidth, $iHeight, 0, 0, $WS_POPUP, $WS_EX_LAYERED + $WS_EX_TOPMOST + $WS_EX_MDICHILD, $hGUI)
GUISetBkColor(0, $hGUI_child)
GUISetState(@SW_SHOW, $hGUI)
GUISetState(@SW_SHOW, $hGUI_child)
SetTransparentBitmap($hGUI, $hImage)
_WinAPI_SetLayeredWindowAttributes($hGUI_child, 0x00, 0xff)
$hGraphic = _GDIPlus_GraphicsCreateFromHWND($hGUI_child)
_GDIPlus_GraphicsFillEllipse($hGraphic, 0, 0, 100, 100)
$Progress1 = _ProgressCreate(20, $iHeight-35, $iWidth-40, 27)
_ProgressSetColors($Progress1, 0x09B8F8, 0x09B8F8, 0xFFFFFF, 0xFFFFFF)
_ProgressSetFont($Progress1, "Courier New", 14)
;~ _GDIPlus_GraphicsDrawImage($hGraphic, $hImage, 0, 0)
[/autoit] [autoit][/autoit] [autoit]#cs
$Input1 = GUICtrlCreateInput("Input1", 156, 132, 121, 21)
$Input2 = GUICtrlCreateInput("Input2", 156, 156, 121, 21)
$Input3 = GUICtrlCreateInput("Input3", 156, 180, 121, 21)
$Slider1 = GUICtrlCreateSlider(128, 212, 150, 45)
$Button1 = GUICtrlCreateButton("Start", 208, 276, 75, 25)
#ce
GUIRegisterMsg($WM_LBUTTONDOWN, "_WM_LBUTTONDOWN")
;~ GUIRegisterMsg($WM_PAINT, "MY_WM_PAINT")
AdlibRegister("_IncProgress",1000)
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
ExitLoop
EndSwitch
WEnd
Func _IncProgress()
if $i < 100 Then $i+=1
_ProgressSet($Progress1, $i)
EndFunc
; Clean up resources
_GDIPlus_GraphicsDispose($hGraphic)
;~ _GDIPlus_ImageDispose($hImage)
_ProgressDelete($Progress1)
_GDIPlus_ShutDown()
Exit
; Draw PNG image
Func MY_WM_PAINT($hWnd, $Msg, $wParam, $lParam)
_GDIPlus_GraphicsDrawImage($hGraphic, $hImage, 0, 0)
_WinAPI_RedrawWindow($hGUI, 0, 0, 1)
Return $GUI_RUNDEFMSG
EndFunc
Func _WM_LBUTTONDOWN($hWnd, $iMsg, $wParam, $lParam)
_SendMessage($hGUI, $WM_SYSCOMMAND, $SC_DRAGMOVE, 0)
EndFunc ;==>_WM_LBUTTONDOWN
Func SetTransparentBitmap($hGUI, $hImage, $iOpacity = 0xFF)
Local $hScrDC, $hMemDC, $hBitmap, $hOld, $pSize, $tSize, $pSource, $tSource, $pBlend, $tBlend
$hScrDC = _WinAPI_GetDC(0)
$hMemDC = _WinAPI_CreateCompatibleDC($hScrDC)
$hBitmap = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hImage)
$hOld = _WinAPI_SelectObject($hMemDC, $hBitmap)
$tSize = DllStructCreate($tagSIZE)
$pSize = DllStructGetPtr($tSize)
DllStructSetData($tSize, "X", _GDIPlus_ImageGetWidth($hImage))
DllStructSetData($tSize, "Y", _GDIPlus_ImageGetHeight($hImage))
$tSource = DllStructCreate($tagPOINT)
$pSource = DllStructGetPtr($tSource)
$tBlend = DllStructCreate($tagBLENDFUNCTION)
$pBlend = DllStructGetPtr($tBlend)
DllStructSetData($tBlend, "Alpha", $iOpacity)
DllStructSetData($tBlend, "Format", 1)
_WinAPI_UpdateLayeredWindow($hGUI, 0, 0, $pSize, $hMemDC, $pSource, 0, $pBlend, $ULW_ALPHA)
_WinAPI_ReleaseDC(0, $hScrDC)
_WinAPI_SelectObject($hMemDC, $hOld)
_WinAPI_DeleteObject($hBitmap)
_WinAPI_DeleteDC($hMemDC)
EndFunc ;==>SetBitmap
Gruß,
UEZ