Hi,
folgendes Skript funktioniert so weit ganz gut
Spoiler anzeigen
#region ;************ Includes ************
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <GDIPlus.au3>
#endregion ;************ Includes ************
Opt("GUIOnEventMode", 1) ; 0=ausgeschaltet, 1=OnEvent Modus aktiviert
[/autoit] [autoit][/autoit] [autoit]Global $hPreviewBitmap
[/autoit] [autoit][/autoit] [autoit]Global $datei1 = "C:\Windows\Web\Wallpaper\Windows\img0.jpg"
[/autoit] [autoit][/autoit] [autoit]_GDIPlus_Startup() ;Vorschau
[/autoit] [autoit][/autoit] [autoit]Global $hPreviewGui = GUICreate("Foto", 350, 250)
Global $hPreviewGraphic = _GDIPlus_GraphicsCreateFromHWND($hPreviewGui)
GUISetOnEvent($GUI_EVENT_CLOSE, "_beenden")
GUISetState()
_PreviewLoadImage($datei1)
GUIRegisterMsg($WM_PAINT, 'WM_PAINT')
While 1
Sleep(10)
WEnd
Func _beenden()
_GDIPlus_BitmapDispose($hPreviewBitmap)
_GDIPlus_GraphicsDispose($hPreviewGraphic)
_GDIPlus_Shutdown()
Exit
EndFunc ;==>_beenden
Func _PreviewLoadImage($sImgFile)
$hPreviewBitmap = _GDIPlus_BitmapCreateFromFile($sImgFile)
_GDIPlus_GraphicsDrawImageRect($hPreviewGraphic, $hPreviewBitmap, 10, 10, 300, 200)
EndFunc ;==>_PreviewLoadImage
Func WM_PAINT($hWnd, $Msg, $wParam, $lParam)
If $hWnd = $hPreviewGui Then _GDIPlus_GraphicsDrawImageRect($hPreviewGraphic, $hPreviewBitmap, 10, 10, 300, 200)
Return $GUI_RUNDEFMSG
EndFunc ;==>WM_PAINT
Wenn ich jedoch die GUI teilweise aus dem Bildschirm rein- und wieder rausschiebe, so ruckelt die GUI etwas.
Dies leigt wohl am neuzeichnen der Grafik.
Kann man dies irgendwie verhindern?
Getestet mit Win 7 64bit.