1.将DOS分解的图片存于数据库中
(1)进入3DS的KeyFrame模块,在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′).asstring);
edit;
fieldbynmae(′picture′).assign(image1.picture.graphics);
next;
end;
end;
end;
2.使用Timer组件实现动画演播
从System页中选择Timer组件放置到窗体Frmpic中,设置属性如下:
NametrmSpeed
EnabledFalse
Interval250
Timer组件的OnTimer事件定期自动发生。例如设置tmrSpeed组件的Interval属性为250,那么,tmrSpeedTimer过程,每隔250毫秒都将会自动执行。为tmrSpeedTimer过程的OnTimer事件填加的代码为:
procedureTform1.Timer1Timer(Sender:Tobject);
begin
table1.next;
iftable1eofthentable1.first;
end;
上一篇: Delphi中用TListView显示数据库数据
下一篇: 用Delphi为窗体的系统菜单中添加选项
文章整理:西部数码--专业提供域名注册、虚拟主机服务
http://www.west263.com
以上信息与文章正文是不可分割的一部分,如果您要转载本文章,请保留以上信息,谢谢!




