Probiere es mal damit:
Spoiler anzeigen
#include <GDIPlus.au3>
_GDIPlus_Startup()
Global Const $IMAGE_BITMAP = 0
Global Const $STM_SETIMAGE = 0x0172
Global $hImage = _GDIPlus_ImageLoadFromFile(StringReplace(@AutoItExe, "autoit3.exe", "Examples\GUI\logo4.gif"))
Global Const $iW = _GDIPlus_ImageGetWidth($hImage)
Global Const $iH = _GDIPlus_ImageGetHeight($hImage)
Global Const $hBmpCtxt = _GDIPlus_ImageGetGraphicsContext($hImage)
[/autoit] [autoit][/autoit] [autoit]_GDIPlus_GraphicsDrawString($hBmpCtxt, "TEST", 10, $iH / 6, "Arial", $iH / 2)
Global $hHBitmap = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hImage)
Global Const $hGUI = GUICreate("Vorher", $iW, $iH)
Global Const $idPic = GUICtrlCreatePic("", 0, 0, $iW, $iH)
_WinAPI_DeleteObject(GUICtrlSendMsg($idPic, $STM_SETIMAGE, $IMAGE_BITMAP, $hHBitmap))
GUISetState()
Do
Until GUIGetMsg() = -3
_GDIPlus_BitmapMask($hImage, "0xFF000000")
[/autoit] [autoit][/autoit] [autoit]_WinAPI_DeleteObject($hHBitmap)
[/autoit] [autoit][/autoit] [autoit]$hHBitmap = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hImage)
_WinAPI_DeleteObject(GUICtrlSendMsg($idPic, $STM_SETIMAGE, $IMAGE_BITMAP, $hHBitmap))
WinSetTitle($hGUI, "", "Nachher")
Do
Until GUIGetMsg() = -3
_WinAPI_DeleteObject($hHBitmap)
_GDIPlus_ImageDispose($hImage)
_GDIPlus_GraphicsDispose($hBmpCtxt)
GUIDelete()
Exit
Func _GDIPlus_BitmapMask(ByRef $hBitmap, $sColor, $iMaskColor = 0xFFFFFFFF)
Local $iX, $iY, $aResult
For $iY = 0 To $iH
For $iX = 0 To $iW
$aResult = DllCall($ghGDIPDll, "uint", "GdipBitmapGetPixel", "handle", $hBitmap, "int", $iX, "int", $iY, "uint*", 0)
If $aResult[4] <> $sColor Then DllCall($ghGDIPDll, "uint", "GdipBitmapSetPixel", "handle", $hBitmap, "int", $iX, "int", $iY, "uint", $iMaskColor)
Next
Next
EndFunc
Ist nicht die schnellste Lösung... Eigentlich was für ASM ![]()
Gruß,
UEZ