2017-12-02 100 views
0

我想在安裝程序中爲控制功能生成動畫。如何在Inno Setup中設置動畫效果

You can see this video

+0

1)您必須用文字解釋您的問題,而不是使用指向外部網站的鏈接。 2)如果您無法用言語表達自己,請至少將視頻上傳到某個值得信賴的網站。 –

+0

我無法解釋我的計劃。我應該在哪裏上傳我的視頻? –

+0

所以你需要一個安裝程序中的按鈕,當點擊時它會展開一個菜單? –

回答

0

可以使用一個計時器來使用動畫InnoTools InnoCallback DLL library

[Files] 
Source: InnoCallback.dll; Flags: dontcopy 

[Code] 

type 
    TTimerProc = procedure(H: LongWord; Msg: LongWord; IdEvent: LongWord; Time: LongWord); 

function SetTimer(hWnd: longword; nIDEvent, uElapse: LongWord; lpTimerFunc: LongWord): 
    LongWord; external '[email protected] stdcall'; 
function KillTimer(hWnd, nIDEvent: LongWord): LongWord; 
    external '[email protected] stdcall'; 

function WrapTimerProc(Callback: TTimerProc; ParamCount: Integer): LongWord; 
    external '[email protected]:innocallback.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); 
var 
    HoverTimerCallback: LongWord; 
begin 
    if WizardForm.OuterNotebook.ActivePage = WizardForm.InnerPage then 
    begin 
    if not MainPanelAnimated then 
    begin 
     HoverTimerCallback := WrapTimerProc(@AnimationTimerProc, 4); 
     AnimationTimer := SetTimer(0, 0, 5, HoverTimerCallback); 
     WizardForm.MainPanel.Left := -WizardForm.MainPanel.Width; 
     MainPanelAnimated := True; 
    end; 
    end; 
end; 

enter image description here

的控制(動畫實際上比圖像顯示更加光滑)

對於從右到左側動畫,請參見Inno Setup - Animate a control roll out from right in a determinate page

+0

如何讓先生更快? –

+0

只需減少'SetTimer'調用的時間間隔和/或增加'ScaleX'調用中的步驟。 –

+0

你讓它工作嗎? –