1.将DOS分解图片存于数据库中
(1)进入3DSKeyFrame模块在Output选项中选择.BMP类型文件将图形文件全部存于同目录中(例如目录c:pic文件可为f0001.bmp...f0045.bmp)
(2)利用Delphi数据工具DeskTop建立个图形数据库Pic.db其中包括图形文件名filename和图片picture两个字段
(3)创建Name为FrmPic窗体Form1从DataAccess页中选择Table组件并将其放入窗体Form1中其属性为:
Nametable1
DataBaseMYWORK
TableNamePic.db
从DataAccess页中选择DataSource组件放入Form1窗体中设置属性为:
NameDataSource1
DataSettable1
从DataControl页中选择DBImage选件放入Form1窗体中设置属性为:
Nameimage1
DataSourceDataSource1
DataFieldPicture
StretchTrue
(4)为FrmPic窗体FormCreate事件填写如下代码:
procedureTform1.FormCreate(Sender:Tobject);
begin
table1.open;
withtable1do
begin
whilenoteofdo
begin
image1.picture.loadfromfile(fieldbyname(′filename′).as);
edit;
fieldbynmae(′picture′).assign(image1.picture.graphics);
next;
end;
end;
end;
2.使用Timer组件实现动画演播
从页中选择Timer组件放置到窗体Frmpic中设置属性如下:
NametrmSpeed
EnabledFalse
Interval250
Timer组件OnTimer事件定期自动发生例如设置tmrSpeed组件Interval属性为250那么tmrSpeedTimer过程每隔250毫秒都将会自动执行为tmrSpeedTimer过程OnTimer事件填加代码为:
procedureTform1.Timer1Timer(Sender:Tobject);
begin
table1.next;
table1eofthentable1.first;
end;
最新评论