Here one way to do it:
#include <WindowsConstants.au3>
#include <GUIConstantsEx.au3>
#include <GDIPlus.au3>
Opt("GUICoordMode", 1)
_GDIPlus_Startup()
Global Const $hBgImage = _GDIPlus_ImageLoadFromFile(StringReplace(@AutoItExe, "autoit3.exe", "Examples\GUI\msoobe.jpg"))
Global Const $iW = _GDIPlus_ImageGetWidth($hBgImage)
Global Const $iH = _GDIPlus_ImageGetHeight($hBgImage)
Global Const $hGUI = GUICreate("GDI+ Test", $iW, $iH)
Global Const $hGraphic = _GDIPlus_GraphicsCreateFromHWND($hGUI)
Global Const $hBitmap = _GDIPlus_BitmapCreateFromGraphics($iW, $iH, $hGraphic)
Global Const $hContext = _GDIPlus_ImageGetGraphicsContext($hBitmap)
Global Const $hFgImage = _GDIPlus_ImageLoadFromFile(StringReplace(@AutoItExe, "autoit3.exe", "Examples\GUI\Torus.png"))
Global Const $iW_Fg = _GDIPlus_ImageGetWidth($hFgImage), $iH_Fg = _GDIPlus_ImageGetHeight($hFgImage)
Global $iPosX = 0, $iPosY = 0
Global Const $hGUI_Child = GUICreate("",$iW_Fg , $iH_Fg, $iPosX, $iPosY, $WS_POPUP, $WS_EX_MDICHILD + $WS_EX_LAYERED + $WS_EX_TRANSPARENT, $hGUI)
Global Const $hGraphic_Child = _GDIPlus_GraphicsCreateFromHWND($hGUI_Child)
GUISetState(@SW_SHOW, $hGUI)
GUISetState(@SW_SHOW, $hGUI_Child)
Global Const $iYCaption = _WinAPI_GetSystemMetrics(4)
Global Const $iYFixedFrame = _WinAPI_GetSystemMetrics(8)
Global Const $iXFixedFrame = _WinAPI_GetSystemMetrics(7)
_GDIPlus_GraphicsDrawImage($hContext, $hBgImage, 0, 0)
_GDIPlus_GraphicsDrawImage($hGraphic, $hBitmap, 0, 0)
SetTransparentBitmap($hGUI_Child, $hFgImage)
Global $fVectorX = Random(1, 3)
Global $fVectorY = Random(1, 3)
AdlibRegister("MoveGUI", 20)
Do
Switch GUIGetMsg()
Case $GUI_EVENT_CLOSE
AdlibUnRegister("MoveGUI")
_GDIPlus_ImageDispose($hBgImage)
_GDIPlus_ImageDispose($hFgImage)
_GDIPlus_BitmapDispose($hBitmap)
_GDIPlus_GraphicsDispose($hContext)
_GDIPlus_GraphicsDispose($hGraphic_Child)
_GDIPlus_GraphicsDispose($hGraphic)
GUIDelete($hGUI_Child)
GUIDelete($hGUI)
_GDIPlus_Shutdown()
Exit
EndSwitch
Until False
Func MoveGUI()
Local $aPos = WinGetPos ($hGUI)
$iPosX += $fVectorX
$iPosY += $fVectorY
WinMove($hGUI_Child, "", $aPos[0] + $iPosX + $iXFixedFrame, $aPos[1] + $iPosY + $iYCaption + $iYFixedFrame)
If $iPosX < 0 Or ($iPosX + $iW_Fg) > $iW Then $fVectorX *= -1
If $iPosY < 0 Or ($iPosY + $iH_Fg) > $iH Then $fVectorY *= -1
EndFunc
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 ;==>SetTransparentBitmap
Br,
UEZ