本帖最后由 3mile 于 2011-7-18 16:50 编辑
11楼楼主脚本报错,不过思路清晰,谢了。
楼上风云 发表于 2011-7-18 12:27
试下这个
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <GDIPlus.au3>
#include <Array.au3>
Opt("GUIOnEventMode",1)
$pic = @ScriptDir & "\2.jpg"
_GDIPlus_Startup()
$hImage = _GDIPlus_ImageLoadFromFile($pic)
$iY = _GDIPlus_ImageGetHeight($hImage)
$iX = _GDIPlus_ImageGetWidth($hImage)
_GDIPlus_ImageDispose($hImage)
_GDIPlus_Shutdown()
$ini=IniReadSectionNames("map.ini")
Local $Label[$ini[0]]
GUICreate("My GUI picture", $iX, $iY , -1, -1, $WS_POPUP + $WS_SYSMENU) ; will create a dialog box that when displayed is centered
GUISetOnEvent(-3,"_exit")
$n = GUICtrlCreatePic("2.jpg", 0, 0, $iX , $iY )
GUICtrlSetState(-1,$gui_disable)
For $i=1 to $ini[0]
$ini_set=IniReadSection("map.ini",$ini[$i])
$temp=StringSplit($ini_set[1][1],",",3)
$Label[$i-1]=GUICtrlCreateLabel("",$temp[0],$temp[1],$temp[2],$temp[3])
GUICtrlSetBkColor(-1,-2)
GUICtrlSetTip(-1,$ini[$i])
GUICtrlSetOnEvent(-1,"_Click")
Next
GUISetState()
; Run the GUI until the dialog is closed
While 1
Sleep(100)
WEnd
Func _exit()
Exit
EndFunc
Func _Click()
msgbox(0,$ini[@GUI_CtrlId-3],IniRead("map.ini",$ini[@GUI_CtrlId-3],"str","ok"))
EndFunc
|