DELPHI编程实现3DS的动画播放Delphi教程
|
| 论文作者:佚名 论文来源:不详 论文发布时间:2006-6-19 22:22:26 论文发布人:chjchjchj |
减小字体
增大字体
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;
|
|
|
|
|
|
|
| ∷相关技术评论 |
(评论内容只代表网友观点,与本站立场无关!) [查看发表评论...] | |
|
|
| |
站内广告 |
| |
|
站内搜索 |
| |
栏目导航 |
| |
|
|
本月热门 |
| |
|
|
本日热门 |
| |
|
|
|