#include <GuiConstantsEx.au3>
#include <GDIPlus.au3>
Dim $images[12]
$images[0] = "0,0,90,90"
$images[1] = "105,0,90,90"
$images[2] = "205,0,220,90"
$images[3] = "0,110,90,90"
$images[4] = "105,110,90,90"
$images[5] = "205,110,220,90"
$images[6] = "0,215,90,90"
$images[7] = "105,220,90,90"
$images[8] = "205,220,220,90"
$images[9] = "0,325,90,90"
$images[10] = "105,325,90,90"
$images[11] = "205,325,220,90"
$form1 = GUICreate("test", 400, 300, @DesktopWidth / 2 - 200, @DesktopHeight / 2 - 150)
$graphic = GUICtrlCreatePic("137a.jpg", 150, 100, 220, 100, 0x0080)
GUICtrlSetBkColor ($graphic,0xffffff)
$lable = GUICtrlCreateLabel ("选择图标:",150,43)
$combo = GUICtrlCreateCombo("", 230, 40)
GUICtrlSetData($combo, "1|2|3|4|5|6|7|8|9|10|11|12", "1")
GUISetState(@SW_SHOW)
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $combo
$sNum = GUICtrlRead($combo) - 1
$x = _makeimg($sNum)
GUICtrlSetImage($graphic, "GDIPlus_" & $sNum & ".bmp")
GUICtrlSetPos($graphic, 150, 100, $x, 90)
FileDelete ("GDIPlus_"&$sNum&".bmp")
EndSwitch
WEnd
Func _makeimg($Num)
Local $hBitmap, $hClone, $hImage, $ix0, $iy0, $iX, $iY
$sResult = $images[$Num]
$aResult = StringSplit($sResult, ",")
$ix0 = $aResult[1]
$iy0 = $aResult[2]
$iX = $aResult[3]
$iY = $aResult[4]
_GDIPlus_Startup()
$hImage = _GDIPlus_ImageLoadFromFile("137a.jpg")
$hClone = _GDIPlus_BitmapCloneArea($hImage, $ix0, $iy0, $iX, $iY)
_GDIPlus_ImageSaveToFile($hClone, "GDIPlus_" & $Num & ".bmp")
_GDIPlus_ImageDispose($hClone)
_GDIPlus_ImageDispose($hImage)
_GDIPlus_Shutdown()
Return $iX
EndFunc ;==>_makeimg