#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#Include <GDIPlus.au3>
GUICreate("", 377, 257, 192, 124)
_GUICtrlCreatePNG(GUICtrlCreatePic("", 5, 10, 363, 240), @ScriptDir & '\1.TIFF')
GUISetState()
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
EndSwitch
WEnd
Func _GUICtrlCreatePNG($Handle, $sImage)
If Not IsHWnd($Handle) Then $Handle = GUICtrlGetHandle($Handle)
_GDIPlus_Startup()
Local $hImages = _GDIPlus_BitmapCreateFromFile($sImage)
_WinAPI_SetWindowLong($Handle, -16, BitOR(_WinAPI_GetWindowLong($Handle, -16), Hex($SS_BITMAP)))
_WinAPI_DeleteObject(_SendMessage($Handle, 0x0172, 0, 0))
_SendMessage($Handle, 0x0172, 0, _GDIPlus_BitmapCreateHBITMAPFromBitmap($hImages))
_GDIPlus_BitmapDispose($hImages)
_GDIPlus_Shutdown()
EndFunc
|