找回密码
 加入
搜索
查看: 4389|回复: 16

au3如何实现象卷轴那样得窗体效果呢?

[复制链接]
发表于 2009-3-13 09:13:49 | 显示全部楼层 |阅读模式
请问:au3如何实现象画卷卷轴那样得窗体卷动效果呢?

javascript代码实现过程中,主要运用了window 对象的三个方法:scroll()  moveTo()  resizeTo()。在实现功能是通过调整IE窗口大小来实现的!
以下是实现代码:
<head>
<script language="javascript">

//let me web site  became a changed page!
window.scroll(0,10);
window.moveTo(725,-15) ;
window.resizeTo(300,0);
   
//setInterval("move()",30);      
setTimeout("move()", 1);      
var width=300     
var height=0  
var a=0
var a1=40

function move()      
{      
      if(height!=400)
   {
     for(a;a<40;a++)
   {

[ 本帖最后由 menfan 于 2009-3-17 21:10 编辑 ]
发表于 2009-3-13 10:56:05 | 显示全部楼层
这样?
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
Opt("GUIOnEventMode", 1)
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 122, 50, 0, 0)
GUISetOnEvent($GUI_EVENT_CLOSE, "Form1Close")
$Button1 = GUICtrlCreateButton("卷", 14, 14, 75, 25, $WS_GROUP)
GUICtrlSetOnEvent(-1, "Button1Click")
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
        Sleep(100)
WEnd

Func Button1Click()
        While 1
                $aWinPos = WinGetPos("Form1")
                If $aWinPos[2] > @DesktopWidth Then ExitLoop
                WinMove("Form1", "", Default, Default, $aWinPos[2] + 20, $aWinPos[3])
                Sleep(1)
        WEnd
EndFunc   ;==>Button1Click

Func Form1Close()
        Exit
EndFunc   ;==>Form1Close
发表于 2009-3-13 11:16:12 | 显示全部楼层
原帖由 sxd 于 2009-3-13 10:56 发表
这样?
[au3]#include
#include
#include
Opt("GUIOnEventMode", 1)
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 122, 50, 0, 0)
GUISetOnEvent($GUI_EVENT_CLOSE, "Form1C ...


不好意思哦,怪我没说清楚,就是像北京奥运会的画布卷动的效果,自上而下卷动。。AU3能实现?
发表于 2009-3-13 11:19:04 | 显示全部楼层
类似于:
function bopMe() {
if (document.all) {
ps.scroll(0,ps.document.body.scrollHeight);
y= ps.document.body.scrollHeight;
} else {
ps.scroll(0,ps.document.height);
y= ps.document.height;
}
}
发表于 2009-3-13 11:33:35 | 显示全部楼层
原帖由 menfan1 于 2009-3-13 11:16 发表


不好意思哦,怪我没说清楚,就是像北京奥运会的画布卷动的效果,自上而下卷动。。AU3能实现?


李宁点火的画卷是从左到右展开。
发表于 2009-3-13 12:34:27 | 显示全部楼层
原帖由 顽固不化 于 2009-3-13 11:33 发表


李宁点火的画卷是从左到右展开。


没错,我就是需要画卷从上到下展开:)
发表于 2009-3-13 14:27:44 | 显示全部楼层
发表于 2009-3-13 14:28:55 | 显示全部楼层
 楼主| 发表于 2009-3-13 15:02:02 | 显示全部楼层
原帖由 漠北雪~狼 于 2009-3-13 14:27 发表
http://www.autoitx.com/forum.php ... &extra=page%3D2


谢了,关键是怎么组合呢?目前我用的是淡入淡出效果,现在想换成画卷卷动的效果哦。

------------------------------
AW_HOR_POSITIVE (0x00000001) '从左到右打开窗口
AW_HOR_NEGATIVE (0x00000002 ) '从右到左打开窗口
AW_VER_POSITIVE (0x00000004) '从上到下打开窗口
AW_VER_NEGATIVE (0x00000008) '从下到上打开窗口
AW_CENTER    (0x00000010) '若使用了AW_HIDE标志,则使窗口向内重叠;若未使用AW_HIDE标志,则使窗口向外扩展。但我的感觉是后者的效果不明显
AW_HIDE     (0x00010000) '在窗体卸载时若想使用本函数就得加上此常量
AW_ACTIVATE   (0x00020000) '在窗体通过本函数打开后,默认情况下会失去焦点,除非加上本常量
AW_SLIDE     (0x00040000) '使用滑动类型。缺省则为滚动动画类型。当使用AW_CENTER标志时,这个标志就被忽略
AW_BLEND     (0x00080000) '淡入淡出效果
-----------------------------------

[ 本帖最后由 menfan 于 2009-3-13 15:03 编辑 ]
 楼主| 发表于 2009-3-14 12:45:46 | 显示全部楼层
顶一下,版主,给个参数吧?
发表于 2009-3-14 16:20:14 | 显示全部楼层
看了一下MSDN,这个效果应该不是AnimateWindow能做出来的
发表于 2009-3-14 23:49:54 | 显示全部楼层
这样?

#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
$GUI = GUICreate("Form1", 300, 200, (@DesktopWidth - 300) / 2, (@DesktopHeight - 200) / 2)
$btn_z = GUICtrlCreateButton("展", 100, 170, 50, 25)
$btn_s = GUICtrlCreateButton("收", 150, 170, 50, 25)
GUISetState(@SW_SHOW)

While 1
        $msg = GUIGetMsg()
        Switch $msg
                Case $GUI_EVENT_CLOSE
                        Exit
                Case $btn_z
                        z()
                Case $btn_s
                        s()
        EndSwitch
WEnd

Func z()
        While 1
                $aWinPos = WinGetPos($GUI)
                If $aWinPos[2] > (@DesktopWidth + 500) / 2 Then ExitLoop
                WinMove($GUI, "", (@DesktopWidth - $aWinPos[2] + 1) / 2, Default, $aWinPos[2] + 20, $aWinPos[3])
                Sleep(2)
        WEnd
EndFunc   ;==>z

Func s()
        While 1
                $aWinPos = WinGetPos($GUI)
                If $aWinPos[2] < 300 Then ExitLoop
                WinMove($GUI, "",(@DesktopWidth - $aWinPos[2] - 1) / 2, Default, $aWinPos[2] - 20, $aWinPos[3])
                Sleep(2)
        WEnd
EndFunc   ;==>s
 楼主| 发表于 2009-3-15 10:41:19 | 显示全部楼层
原帖由 298311657 于 2009-3-14 23:49 发表
这样?

[au3]#include
#include
#include
$GUI = GUICreate("Form1", 300, 200, (@DesktopWidth - 300) / 2, (@DesktopHeight - 200) / 2)
$btn_z = GUICtrlCreateButton("展", 100, 170, 50, 25)
$btn_s ...


------这是平移效果,不是我说得卷动效果哦,还有其他的吗?
 楼主| 发表于 2009-3-17 21:09:53 | 显示全部楼层
AnimateWindow搞不定,还是想想别的办法吧。
发表于 2009-3-17 21:28:41 | 显示全部楼层
貌似很难吧~~期待ing
您需要登录后才可以回帖 登录 | 加入

本版积分规则

QQ|手机版|小黑屋|AUTOIT CN ( 鲁ICP备19019924号-1 )谷歌 百度

GMT+8, 2024-5-19 15:01 , Processed in 0.081859 second(s), 20 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表