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 picture 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;