#include #include Func PpngGuiCreatePic($src, $x, $y, $scale = 1, $alt = "",$gdi = 1) If $gdi = 1 Then _GDIPlus_Startup() $hImage2 = _GDIPlus_ImageLoadFromFile($src) $ImageHeight = (_GDIPlus_ImageGetHeight($hImage2)) * $scale $ImageWidth = (_GDIPlus_ImageGetWidth($hImage2)) * $scale If $scale <> 1 Then $hBitmap = _WinAPI_CreateBitmap($ImageWidth, $ImageHeight, 1, 32) $hImage1 = _GDIPlus_BitmapCreateFromHBITMAP($hBitmap) $hgraphic = _GDIPlus_ImageGetGraphicsContext($hImage1) _GDIPlus_GraphicsDrawImageRect($hgraphic, $hImage2, 0, 0, $ImageWidth, $ImageHeight) $hBitmap2 = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hImage1) _WinAPI_DeleteObject($hBitmap) _GDIPlus_ImageDispose($hImage1) _GDIPlus_GraphicsDispose($hgraphic) Else Local _ $hBitmap = _GDIPlus_BitmapCreateFromFile($src), _ $hBitmap2 = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hBitmap) _GDIPlus_BitmapDispose($hBitmap) EndIf $pic = GUICtrlCreatePic("", $x, $y, $ImageWidth, $ImageHeight) If $alt <> "" Then GUICtrlSetTip($pic, $alt) GUICtrlSendMsg($pic, 0x0172, 0, $hBitmap2) If $gdi = 1 Then _GDIPlus_Shutdown() Return $pic EndFunc ;==>PngGuiCreatePic