#include <GuiConstantsEX.au3>
#include <GDIPlus.au3>
#include "resources.au3"
#include <GUIConstants.au3>
#include <WindowsConstants.au3>
Global $hGui, $iExt
Global $hPic, $hImage, $hGraphic
_GDIPlus_Startup()
$hGui = GUICreate("Form1", @DesktopWidth - 1000, @DesktopHeight - 700, -1, -1, $ws_popup)
$hPic = GUICtrlCreatePic("image2.bmp", 25, 25, 300, 200)
GUISetState()
While 1
$msg = GUIGetMsg()
Switch $msg
$OpenFile = FileOpenDialog("Select image file", "", "image(*.png)")
_GUICtrlStatic_SetPicture($OpenFile, $hPic)
Case $GUI_EVENT_CLOSE
ExitLoop
EndSwitch
WEnd
Func _GUICtrlStatic_SetPicture($File, $CtrlId)
$hImage = _GDIPlus_ImageLoadFromFile($File)
$hScrDC = _WinAPI_GetDC(0)
$hMemDC = _WinAPI_CreateCompatibleDC($hScrDC)
$hBitmap = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hImage)
GUICtrlSetImage($CtrlId, "")
_SetBitmapToCtrl($CtrlId, $hBitmap)
EndFunc ;==>_GUICtrlStatic_SetPicture
image2.bmp这个图倒是能显示出来了,现在想做这个选择点击一下图片,弹出另一个IE窗口.
大家多多指教
[ 本帖最后由 木纳 于 2008-5-15 16:02 编辑 ] |