Jump to content
TanerJames

PNG with objects on single GUI

Recommended Posts

Hi,

I am using transparent PNG image.

i don't add Button, Label etc. on this GUI.

 

I looked at other examples.
They do it with two GUI. ($ WS_EX_MDICHILD etc.) but I just want to do this with single GUI.

In other one GUI examples, there is a PNG image, but it does not have a transparent feature. (Semi-transparent etc.)

 

Can't we use PNG image (transparent) and normal control objects (button, label etc.) with a single GUI?

 

Thanks.

 

i want to like this:

171233658_Clipboard2.png.4937c19c4eabe1ff0797be2f3f5ecb11.png

 

Example transparent PNG code:

#include <ButtonConstants.au3>
#include <MsgBoxConstants.au3>
#include <StructureConstants.au3>
#include <WinAPIConstants.au3>
#include <GDIPlus.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <WinAPISysWin.au3>

_GDIPlus_Startup()
Global Const $SC_DRAGMOVE = 0xF012
Global $iW, $iH, $hImage, $hBitmap, $hGUI
$hImage = _GDIPlus_BitmapCreateFromMemory(_Image())

$hBitmap = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hImage)
$iW = _GDIPlus_ImageGetWidth($hImage)
$iH = _GDIPlus_ImageGetHeight($hImage)
$hGUI = GUICreate("", $iW, $iH, -1, -1, $WS_POPUP, BitOR($WS_EX_LAYERED,$WS_EX_TOPMOST))
GUISetState()

Global Const $cButton = GUICtrlCreateButton("Exit", 10, 5, 30, 30)

_WinAPI_BitmapDisplayTransparentInGUI($hBitmap, $hGUI)



GUIRegisterMsg($WM_LBUTTONDOWN, "_WM_LBUTTONDOWN")


Do
Until GUIGetMsg() = $GUI_EVENT_CLOSE

_WinAPI_DeleteObject($hBitmap)
_GDIPlus_BitmapDispose($hImage)
_GDIPlus_Shutdown()
GUIDelete()



Func _WinAPI_BitmapDisplayTransparentInGUI(ByRef $hHBitmap, ByRef $hGUI, $iOpacity = 0xFF, $bReleaseGDI = True)
    If Not BitAND(GUIGetStyle($hGUI)[1], $WS_EX_LAYERED) = $WS_EX_LAYERED Then Return SetError(1, 0, 0)
    Local $tDim = DllStructCreate($tagBITMAP)
    If Not _WinAPI_GetObject($hHBitmap, DllStructGetSize($tDim), DllStructGetPtr($tDim)) Then Return SetError(2, 0, 0)
    Local $tSize = DllStructCreate($tagSIZE), $tSource = DllStructCreate($tagPOINT), $tBlend = DllStructCreate($tagBLENDFUNCTION)
    Local Const $hScrDC = _WinAPI_GetDC(0), $hMemDC = _WinAPI_CreateCompatibleDC($hScrDC), $hOld = _WinAPI_SelectObject($hMemDC, $hHBitmap)
    $tSize.X = $tDim.bmWidth
    $tSize.Y = $tDim.bmHeight
    $tBlend.Alpha = $iOpacity
    $tBlend.Format = 1
    _WinAPI_UpdateLayeredWindow($hGUI, $hScrDC, 0, DllStructGetPtr($tSize), $hMemDC, DllStructGetPtr($tSource), 0, DllStructGetPtr($tBlend), $ULW_ALPHA)
    _WinAPI_ReleaseDC(0, $hScrDC)
    _WinAPI_SelectObject($hMemDC, $hOld)
    _WinAPI_DeleteDC($hMemDC)
    If $bReleaseGDI Then _WinAPI_DeleteObject($hHBitmap)
    Return True
EndFunc

Func _WM_LBUTTONDOWN($hWnd, $iMsg, $wParam, $lParam)
    _SendMessage($hGUI, $WM_SYSCOMMAND, $SC_DRAGMOVE, 0)
EndFunc   ;==>_WM_LBUTTONDOWN

;Code below was generated by: 'File to Base64 String' Code Generator v1.20 Build 2018-02-02

Func _Image()
    Local $Image
    $Image &= 'iVBORw0KGgoAAAANSUhEUgAAAQQAAAEVCAMAAAAxXGsGAAACE1BMVEVHcEwCAgEIBgUEAACcLi4EAwMGAwOHAQ2qARCTAQyRAQmkAQt8CA47LiibARCzAQzAAQ3LAg7WAg/gAhAIBgbrAQ95AAMEAQEZFxIGAwN8AAIEBATl3rUMBgVnY1Lp37XZzqLm26/Mw5rv5bnx6bve1am6sI3r477CHib07MLp3rLVypvXz6zWzKDw5LP37LnZz6XXzaPSyKHg1KTTyJrb0ano3KrZ0Kff7LioWUrfLTzmQVDYzqPHfmnbFya6a1jKn4CTLinl3LTd1K7c06zr4LPe1rDQr43f17Lb0qoFBQXQxJMHAQHtZXPf1rHNxJ3Vyp0DAwMFAgLGvpjCupW+tpLJyqYDAwPIwZy6sY6apX6QnHfZ1bIEAgKmrYi1rYsEAgJziFwEAwNkfk8DAwOBkmgDAwMDAwMDAgIDAwMEAgIDAgIDAgIjIBoEAwMFBATg2LQ2Myzk3Lvn4MFGQzjd063Zz6bx68/j3Lrf1rJeWkv89NPh2bZwbFvi2rj/+9t6dmdUcz8PUAIsXRyytpHh2LWVjnTm379CaS8sXRuNm3EDAgKspYoDAgIDAgIDAgIEAwMKCQjCvKLd2LkDAgIEAwPp48UDAgLt583l3b1VdUHo4cQEAgL999Lr5ckEAwPs5svr48Q5NiwEAgIDAQFfW07q5MfRxphuaVjl3r5NSkHo4cL//+YEAgIDAgIEAgIEAgLeQ1HhAAAAsXRSTlMAAQQQRzYaarjj//+7XJD//////yv//wwISPAlGxcmvKyEbW5ZTFQw/53Q3/P////////+///////////////////////v/////yH/FP////8oQP////8v//////88//9F/1v/S/9OU2hXX2VzhWsd/43//4r//////5P//53//rX//////9b/////b+SAi4+Wn+r/enf/ff////+D4P+T/+WnmYe/'
    $Image &= '///H/6f//0JiMzp0cOCKAAAkbUlEQVR42uSWh5bjIAxFfVNtyBo8TGv//50bSBUeZM85ZutzpaMryUmzpFBK2gBGVav1Zru61XFu4Vwk74+4CSEWqa98ZxoOKBWa3b7tOmO7w484FPK+RXNAsRWlckmhAEFanIm7ht5e1e5GQxBwmUSBuj+qkJiP++ZiRNfWRrl0N3aTTzEdFNyBQwH/S/MClTVZ8vTWOefT6SKG/Uykks4NgjKIpdGg7xAKRmT1bCIC7wd/VMJgNgtGILKeOqkAk7GJ2r93RwJnRQzWtgpdPaWZ9EMFCMVFQCEkmw4RwcNJCYN1G4FSW5U5ScndpmjqCR0zV2sY2df7aH4IIWFIFPpC2s8OSpSd1BRoZQobgmbvQkSQlCg4257Howyc4RakE35XDOjIIJ6PJpr/lI4QEoW2BPZWL9uY/DxSyXQEgvw+Xw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m8fgz9baDNS5BOwZpWQazxJB/qAbmusMfT2BrH0mOSxKvP3LEDwnpIABu/tj8nNt7n6vA/i1CA+2sEcJYbrposOwAkt50VUuouH2ypRlK7DJX2pn00MmjOmO4YT80CQQHRmTtZmdXxm7ja0XchTbGYF3BLNw0Xk4CSFMyNl0nELY/7RKBtDLxDQwnDUrOt6vyNmWkqbfFltmcSeN5/uSDd9FjHaJlQCm4kHbUal9ppUHmyJjv4URhIMC/LmHM7FxpsqGq1Fegok93hP0X2A8u+PR+vyYdBVAeXls0CYb7Mp43tLhzRty3ZK//LbDOSsL+KC5bGNfdcHd5/4f27+4Z6T8Zv3ETjnu8lgAAAABJRU5ErkJggg=='
    Local $bString = _WinAPI_Base64Decode($Image)
    If @error Then Return SetError(1, 0, 0)
    $bString = Binary($bString)

    Return $bString
EndFunc   ;==>_Image

Func _WinAPI_Base64Decode($sB64String)
    Local $aCrypt = DllCall("Crypt32.dll", "bool", "CryptStringToBinaryA", "str", $sB64String, "dword", 0, "dword", 1, "ptr", 0, "dword*", 0, "ptr", 0, "ptr", 0)
    If @error Or Not $aCrypt[0] Then Return SetError(1, 0, "")
    Local $bBuffer = DllStructCreate("byte[" & $aCrypt[5] & "]")
    $aCrypt = DllCall("Crypt32.dll", "bool", "CryptStringToBinaryA", "str", $sB64String, "dword", 0, "dword", 1, "struct*", $bBuffer, "dword*", $aCrypt[5], "ptr", 0, "ptr", 0)
    If @error Or Not $aCrypt[0] Then Return SetError(2, 0, "")
    Return DllStructGetData($bBuffer, 1)
EndFunc   ;==>_WinAPI_Base64Decode

 

 

 

Other example single GUI. (but transparent problem)

1180704571_Clipboard4.png.86093724de2eb54ff94ad5bae621be00.png

#include <GDIPlus.au3>
#include <WinAPI.au3>
#include <WindowsConstants.au3>

Global  $hGraphic

_GDIPlus_Startup()
; Load PNG image
$hImage = _GDIPlus_ImageLoadFromFile(@ProgramFilesDir & "\AutoIt3\Examples\GUI\msoobe.jpg")
$iWidth = _GDIPlus_ImageGetWidth($hImage)
$iHeight = _GDIPlus_ImageGetHeight($hImage)

Dim $Image_OneButton = @ProgramFilesDir & "\AutoIt3\Examples\GUI\Torus.png"
$hImage_One = _GDIPlus_ImageLoadFromFile($Image_OneButton)
$iW_One = _GDIPlus_ImageGetWidth($hImage_One)
$iH_One = _GDIPlus_ImageGetHeight($hImage_One)
$hBitmap_One = _GDIPlus_BitmapCloneArea($hImage_One, 0, 0, $iW_One, $iH_One, $GDIP_PXF32ARGB)
$hBmp_One = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hBitmap_One)
_GDIPlus_BitmapDispose($hBitmap_One)
_GDIPlus_ImageDispose($hImage_One)


; Create GUI
$hGUI = GUICreate("Show PNG", $iWidth, $iHeight, -1, -1, $WS_POPUP, $WS_EX_LAYERED)



$hButton = GUICtrlCreateButton("Exit", $iWidth * 2 / 3, $iHeight * 2 / 3, 40, 40)
$a = GUICtrlCreatePic("",46,46,$iW_One,$iH_One)
 GUICtrlSendMsg($a , 0x0172, 0, $hBmp_One)
GUISetBkColor(0xCCFFCC, $hGUI)
GUISetState(@SW_SHOW, $hGUI)
SetTransparentBitmap($hGUI, $hImage)
_WinAPI_SetLayeredWindowAttributes($hGUI, 0xCCFFCC, 0xff)


While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case -3, $hButton

            _GDIPlus_ImageDispose($hImage)
            _GDIPlus_GraphicsDispose($hGraphic)
            _GDIPlus_Shutdown()
            GUIDelete($hGUI)
            ExitLoop
    EndSwitch
WEnd



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, $hMemDC, 0, $pSize, $hMemDC, $pSource, 0, $pBlend, $ULW_ALPHA)
    _WinAPI_ReleaseDC(0, $hScrDC)
    _WinAPI_SelectObject($hMemDC, $hOld)
    _WinAPI_DeleteObject($hBitmap)
    _WinAPI_DeleteDC($hMemDC)
EndFunc

 

Edited by TanerJames

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...