如何在Inno Setup中为控件展开动画 [英] How to animate a control roll out in Inno Setup
本文介绍了如何在Inno Setup中为控件展开动画的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想为安装程序中的控件展开动画.
I want to animate a control roll out in my installer.
推荐答案
您可以使用计时器为控件添加动画.
You can use a timer to animate a control.
[Code]
function SetTimer(hWnd: longword; nIDEvent, uElapse: LongWord; lpTimerFunc: LongWord):
LongWord; external 'SetTimer@user32.dll stdcall';
function KillTimer(hWnd, nIDEvent: LongWord): LongWord;
external 'KillTimer@User32.dll stdcall';
var
MainPanelAnimated: Boolean;
AnimationTimer: LongWord;
procedure AnimationTimerProc(
H: LongWord; Msg: LongWord; IdEvent: LongWord; Time: LongWord);
var
L: Integer;
begin
L := WizardForm.MainPanel.Left + ScaleX(5);
if L > 0 then
begin
L := 0;
KillTimer(0, AnimationTimer);
end;
WizardForm.MainPanel.Left := L;
end;
procedure CurPageChanged(CurPageID: Integer);
begin
if WizardForm.OuterNotebook.ActivePage = WizardForm.InnerPage then
begin
if not MainPanelAnimated then
begin
AnimationTimer := SetTimer(0, 0, 5, CreateCallback(@AnimationTimerProc));
WizardForm.MainPanel.Left := -WizardForm.MainPanel.Width;
MainPanelAnimated := True;
end;
end;
end;
对于 CreateCallback
函数,您需要Inno设置6.如果您对Inno Setup 5不满意,则可以使用 InnoTools中的WrapCallback
函数InnoCallback 库.
For CreateCallback
function, you need Inno Setup 6. If you are stuck with Inno Setup 5, you can use WrapCallback
function from InnoTools InnoCallback library.
(动画实际上比图像显示的要平滑)
有关从右到左的动画,请参见 Inno设置-在确定的页面中从右向右滚动控件
For right-to-left animation, see Inno Setup - Animate a control roll out from right in a determinate page.
这篇关于如何在Inno Setup中为控件展开动画的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文