Delphi programming to play no sound avi animation

Source: Internet
Author: User
This example shows how to show an AVI animated file without sound while the program is running.

Add a tanimate component to the form and set its Commonavi property to Avicopyfile so that the animation of the copied file is displayed in the Tanimate component. The form after you add the component is shown in Figure 1.


Figure 1 form after adding a component

Add the following code during the initialization of the form:

Procedure Tform1.formcreate (Sender:tobject);
Begin
Self. Animate1.active:=true;
End

In this way, the program activates the Tanimate component at the beginning of the program's operation, thus starting to play the animated avicopyfile of the copied file.

The program code is as follows:

Unit Unit1;
Interface
Uses

Windows, Messages, sysutils, variants, Classes, Graphics, Controls, Forms,

Dialogs, Comctrls;

Type
TForm1 = Class (Tform)
Animate1:tanimate;
Procedure Formcreate (Sender:tobject);
Private
{Private declarations}
Public
{Public declarations}
End

Var
Form1:tform1;
Implementation
{$R *.DFM}
Procedure Tform1.formcreate (Sender:tobject);
Begin
Self. Animate1.active:=true;
End

End.

Save the file, and then press F9 to run the program, and the results of the program run as shown in Figure 2.


Figure 2 Program Run results

The program does not call AVI animation files in the disk, the reader in their own applications can be specified Tanimate component of the FileName property to play a no sound avi animation files.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.