Delphi programming to achieve 3DS animation playback

Source: Internet
Author: User

Delphi is a powerful programming language that makes it easy to create any kind of database application. The 3DS animation file. FLC decomposition, according to the order of the graphics data type provided by Delphi, by reading graphics type of graphic data, in the window to achieve animation effect.

1. To save a DOS decomposed picture in a database

(1) Enter the 3DS keyframe module and select it in the Output option. BMP type of file. All graphics files are stored in the same directory (for example, the directory c:\pic, and the file can be f0001.) BMP, ... , f0045. BMP).

(2) Use Delphi Data Tool Desktop to build a graph database pic. DB, which includes graphics filename filename and picture picture two fields.

(3) Create a form Form1 with name Frmpic, select the table component from the DataAccess page and put it into the form Form1 with the properties:

Name table1
DataBase MYWORK
TableName Pic.db

Select the DataSource component from the DataAccess page, put it in the Form1 form, and set the property to:

Name DataSource1
DataSet table1

Select the Dbimage option from the DataControl page, put it in the Form1 form, and set the property to:

Name image1
DataSource DataSource1
DataField Picture
Stretch True

(4) Fill in the following code for the Formcreate event for the Frmpic form:

procedureTform1.FormCreate(Sender:Tobject);
begin
table1.open;
with table1 do
begin
while not eof do
begin
image1.picture.loadfromfile(fieldbyname(filename).asstring);
edit;
fieldbynmae(picture).assign(image1.picture.graphics);
next;
end;
end;
end;

2. Animate the studio with the Timer component

From the System page, select the Timer component to drop into form frmpic and set the properties as follows:

Name trmSpeed
Enabled False
Interval 250

The Timer component's OnTimer event occurs automatically on a regular basis. For example, to set the interval property of the Tmrspeed component to 250, the Tmrspeedtimer process is automatically performed every 250 milliseconds. The code to fill the OnTimer event for the Tmrspeedtimer process is:

procedureTform1.Timer1Timer(Sender:Tobject);
begin
table1.next;
if table1.eof then
table1.first;
end;

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.