GDI + Png spezielle Progressbar

  • Hallo,

    ich komme hier nicht ganz weiter mit dem GDI +. Ich habe etwas herumgebastelt, aber es wird auf irgendeiner Art und Weise nichts.
    Folgendes will ich erreichen :
    ProgressBarLadeBalken als Bild, wobei es in der Umrandung, transparent bleiben soll, also, sodass ich das Hintergrundbild solange sehe.
    Hintergrundbild sichtbar machen ...
    Dieses bekomme ich aber nicht ganz hin.
    Könnte mir mal bitte jemand helfen? Hier mal mein Versuch :

    Spoiler anzeigen
    [autoit]


    #include <ButtonConstants.au3>
    #include <EditConstants.au3>
    #include <GDIPlus.au3>
    #include <GUIConstantsEx.au3>
    #include <StaticConstants.au3>
    #include <WindowsConstants.au3>
    _GDIPlus_Startup()
    $GUI = GUICreate("Progressbartest", 659, 62, 192, 124)
    $Background = GUICtrlCreatePic("",192,124,659, 62)
    $ProgressbarUmrandung = GUICtrlCreatePic("", 32, 24, 598, 25) ; Transparente Progressbarumrandung
    $ProgressbarLadeBalken = GUICtrlCreatePic("", 32, 24, 598, 25) ; 598 : 100 = 5,98
    $ProgressFortschritt = 0
    GUISetState(@SW_SHOW)
    DisplayImage($Background,@ScriptDir & "\Background.png")
    DisplayImage($ProgressbarUmrandung,@ScriptDir & "\TransparentProgressBackground.png")
    While 1
    DisplayImageProgress($ProgressbarLadeBalken,@ScriptDir & "\ProgressbarLadebalken.png",$ProgressFortschritt)
    $ProgressFortschritt += 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    _GDIPlus_Shutdown()
    Exit
    EndSwitch
    WEnd

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    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

    [/autoit] [autoit][/autoit] [autoit]

    Func DisplayImageProgress($id, $file,$weight)
    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", $weight, "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,$weight, $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

    [/autoit]


    Die Bilder habe ich als Anhang auch hochgeladen.
    Könnte man dies vielleicht zusammen mit der UDF hier :[ offen ] GDI + Png spezielle Progressbarumsetzen?