#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <GDIPlus.au3>
$Form1 = GUICreate("Form1", 623, 449, 192, 114)
_GDIPlus_Startup ()
$Image = _GDIPlus_ImageLoadFromFile (@DesktopDir & "\test.jpg")
$w=_GDIPlus_ImageGetWidth($Image) ;图片宽
$h=_GDIPlus_ImageGetHeight($Image) ;图片高
_GDIPlus_ImageDispose($Image);应该要先释放图像对象吧
_GDIPlus_ShutDown ()
$Pic1 = GUICtrlCreatePic(@DesktopDir & "\test.jpg", 64, 24, $w, $h)
;即使在这里去掉$w,$h,填别的数字,图片也不能显示
GUISetState(@SW_SHOW)
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
EndSwitch
WEnd
|