请教一个关于GUICtrlCreatePic 的问题[已解決]
本帖最后由 binshiwo 于 2011-4-23 17:08 编辑如下图片,但是PIC控件的两个卷动条无法使用。
我想要的效果是把图片最大话显示在控件里面,但是控件是固定的大小300*300。然后可以通过卷动条来左右移动它观察图片。
该怎么实现呢?请教各位。
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 471, 411, 249, 190, BitOR($WS_SYSMENU,$WS_POPUP,$WS_HSCROLL))
$Pic1 = GUICtrlCreatePic("C:\Documents and Settings\All Users\Documents\My Pictures\範例圖片\Sunset.jpg", 56, 40, 305, 273, BitOR($GUI_SS_DEFAULT_PIC,$WS_HSCROLL,$WS_VSCROLL))
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
EndSwitch
WEnd
把图片的位置和卷动条的值关联起来就行了 可以把图片作为listview的背景试试
_GUICtrlListView_SetBkImage 函数 本帖最后由 binshiwo 于 2011-4-23 17:10 编辑
多谢1楼2楼得回答。
我想到了一个新的方法。
下面是代码:#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 276, 250, 240, 201, BitOR($GUI_SS_DEFAULT_GUI,$WS_HSCROLL,$WS_VSCROLL))
$Pic1 = GUICtrlCreatePic("C:\Documents and Settings\All Users\Documents\My Pictures\範例圖片\Blue hills.jpg", -8, -40, 600, 600)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
EndSwitch
WEnd
回复 4# binshiwo
这个方法不行。。 回复 5# itljl
当然,因为还没有加上滚动的内容。
这里有一篇可以参考:http://www.autoitx.com/forum.php?mod=viewthread&tid=21286&highlight=%B4%B0%BF%DA%B9%F6%B6%AF 回复 6# binshiwo
这个用在图片上不行的。我以前试过。
图片比如800*600 ,滚动条不准的。 回复 7# itljl
恩!看来只能想其他办法了。
这个滚动条还真是个摆设的。
现在或许只能人工做个滚动条。
页:
[1]