Hier noch eine andere Variante:
Spoiler anzeigen
#include <GDIPlus.au3>
#include <GUIConstantsEx.au3>
#include <GuiListView.au3>
#include <ListViewConstants.au3>
#Include <WinAPIEx.au3>
#include <WindowsConstants.au3>
Global $hGraphic, $hBitmap, $hBackbuffer, $hImage, $hTexture, $hBMP
Global Const $STM_SETIMAGE = 0x0172, $vGUIWidth = 400, $vGUIHeight = 400
#region GDI+
_GDIPlus_Startup()
$hImage = _GDIPlus_ImageLoadFromFile(@ScriptDir & "\test.jpg")
$iW = _GDIPlus_ImageGetWidth($hImage)
$iH = _GDIPlus_ImageGetHeight($hImage)
$hGraphic= _GDIPlus_GraphicsCreateFromHWND(WinGetHandle(AutoItWinGetTitle()))
$hBitmap = _GDIPlus_BitmapCreateFromGraphics($vGUIWidth, $vGUIHeight, $hGraphic)
$hContext = _GDIPlus_ImageGetGraphicsContext($hBitmap)
$hTexture = _GDIPlus_TextureCreate($hImage)
_GDIPlus_GraphicsFillRect($hContext , 0, 0, $vGUIWidth, $vGUIHeight, $hTexture)
$hBmp = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hBitmap)
#endregion
Global $hGUI = GUICreate("", $vGUIWidth, $vGUIHeight)
GUISetBkColor(0x000000, $hGUI)
Global $Pic = GUICtrlCreatePic("", 0, 0)
GUICtrlSendMsg($Pic, $STM_SETIMAGE, 0, $hBmp)
GUICtrlSetState(-1, $GUI_DISABLE)
Global $b = GUICtrlCreateButton("Exit", 10, $vGUIHeight - 50)
[/autoit] [autoit][/autoit] [autoit]Global $lv = GUICtrlCreateListView("SPALTE1|SPALTE2", 10, 10, 200, 200, $LVS_NOCOLUMNHEADER)
GUICtrlSetBkColor(-1, 0xE0E0F0)
GUICtrlSetColor(-1, 0x002000)
_GuiCtrlMakeTrans(-1, 0xE0)
_SetXPStyle(0)
Global $g = GUICtrlCreateGroup("Gruppe1", 220, 10, 160, 150)
GUICtrlSetColor(-1, 0x000040)
GUICtrlSetBkColor(-1, -2);...
_SetXPStyle(1)
GUISetState()
[/autoit] [autoit][/autoit] [autoit]For $i = 0 To 50
_GUICtrlListView_AddItem($lv, Random(0x111111, 0xFFFFFF, 1))
Next
Do
Until GUIGetMsg() = -3
_GDIPlus_GraphicsDispose($hContext)
_GDIPlus_BrushDispose($hTexture)
_GDIPlus_ImageDispose($hImage)
_GDIPlus_BitmapDispose($hBitmap)
_GDIPlus_GraphicsDispose($hGraphic)
_GDIPlus_Shutdown()
GUIDelete($hGUI)
Exit
Func _SetXPStyle($b_Set = 1); 0 = deactivate, 1 = activate
DllCall("uxtheme.dll", "none", "SetThemeAppProperties", "int", $b_Set * 7)
EndFunc
Func _GDIPlus_TextureCreate($hImage, $iWrapMode = 0)
Local $aResult = DllCall($ghGDIPDll, "uint", "GdipCreateTexture", "hwnd", $hImage, "int", $iWrapMode, "int*", 0)
If @error Then Return SetError(@error, @extended, 0)
Return $aResult[3]
EndFunc ;==>_GDIPlus_TextureCreate
Func _GuiCtrlMakeTrans($iCtrlID, $iTrans=255)
Local $pHwnd, $nHwnd, $aPos, $a
$hWnd = GUICtrlGetHandle($iCtrlID);Get the control handle
If $hWnd = 0 then Return SetError(1,1,0)
$pHwnd = DllCall("User32.dll", "hwnd", "GetParent", "hwnd", $hWnd);Get the parent Gui Handle
If $pHwnd[0] = 0 then Return SetError(1,2,0)
$aPos = ControlGetPos($pHwnd[0],"",$hWnd);Get the current pos of the control
If @error then Return SetError(1,3,0)
$nHwnd = GUICreate("", $aPos[2], $aPos[3], $aPos[0], $aPos[1], 0x80000000, 0x00080000 + 0x00000040, $pHwnd[0]);greate a gui in the position of the control
If $nHwnd = 0 then Return SetError(1,4,0)
$a = DllCall("User32.dll", "hwnd", "SetParent", "hwnd", $hWnd, "hwnd", $nHwnd);change the parent of the control to the new gui
If $a[0] = 0 then Return SetError(1,5,0)
If NOT ControlMove($nHwnd,'',$hWnd,0,0) then Return SetError(1,6,-1);Move the control to 0,0 of the newly created child gui
GUISetState(@SW_Show,$nHwnd);show the new child gui
WinSetTrans($nHwnd,"",$iTrans);set the transparency
If @error then Return SetError(1,7,0)
GUISwitch($pHwnd[0]);switch back to the parent Gui
Return $nHwnd;Return the handle for the new Child gui
EndFunc
Gruß,
UEZ