天天笑 发表于 2014-4-25 18:16:32

GUICtrlCreatePic如何初始化

GUICtrlCreatePic如何初始化,源码如下:
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
$Form1 = GUICreate("Form1", @DesktopWidth, @DesktopHeight, -1, -1,$WS_SIZEBOX+$WS_MINIMIZEBOX+$WS_MAXIMIZEBOX)
$Next = GUICtrlCreateButton("Next", @DesktopWidth-200, @DesktopHeight-100, 80, 30)
GUICtrlSetFont(-1, 20, 10000, 0, "@新宋体")
$jpgR=GUICtrlCreatePic("",0,60,@DesktopWidth/2-5, @DesktopHeight/2)
$jpgC=GUICtrlCreatePic("", @DesktopWidth/2+5, 60, @DesktopWidth/2, @DesktopHeight/2)
$jpgR21=GUICtrlCreatePic("",0,60,@DesktopWidth/4-2, @DesktopHeight/2)
$jpgR22=GUICtrlCreatePic("",@DesktopWidth/4,60,@DesktopWidth/4-2, @DesktopHeight/2)
$jpgR41=GUICtrlCreatePic("",0,60,@DesktopWidth/4-2, @DesktopHeight/4)
$jpgR42=GUICtrlCreatePic("",0,60+@DesktopHeight/4+2,@DesktopWidth/4-2, @DesktopHeight/4)
$jpgR43=GUICtrlCreatePic("",@DesktopWidth/4+2,60,@DesktopWidth/4-2, @DesktopHeight/4)
$jpgR44=GUICtrlCreatePic("",@DesktopWidth/4+2,60+@DesktopHeight/4+2,@DesktopWidth/4-2, @DesktopHeight/4)
GUISetState(@SW_SHOW)
$i=0
While 1
      $nMsg = GUIGetMsg()
      Select
Case $nMsg = $GUI_EVENT_CLOSE
ExitLoop
        Case $nMsg =$Next
                                $i=$i+1
                                If $i=1 Then
        GUICtrlSetImage($jpgR,"E:\Result\A001.jpg")
        GUICtrlSetImage($jpgC21,"E:\Criteria\A001.jpg")
        GUICtrlSetImage($jpgC22,"E:\Criteria\A001.jpg")
EndIf
If $i=2 Then
        GUICtrlSetImage($jpgR41,"E:\Result\A001.jpg")
        GUICtrlSetImage($jpgR42,"E:\Result\A001.jpg")
        GUICtrlSetImage($jpgR43,"E:\Result\A001.jpg")
        GUICtrlSetImage($jpgC21,"E:\Criteria\A001.jpg")
        GUICtrlSetImage($jpgC22,"E:\Criteria\A001.jpg")
EndIf
                                EndSelect                               
WEnd

当运行后,后面的图片不会完全遮挡之前的图片。
希望结果:可以初始化GUICtrlCreatePic,然后按下Next按钮之后,会显示当前需要的图片,上一次显示的图片就不再显示

skyfree 发表于 2014-4-25 19:41:55

例如:GUICtrlSetImage($jpgR,"")
页: [1]
查看完整版本: GUICtrlCreatePic如何初始化