Programming and Application(编程与应用)


Content(目录)




Linux


MySQL
Office















 
PCNow 30-Day Free Trial, Remote PC Access
 
Logo_234x60

中文幻灯的制作与放映


中文幻灯片制作与放映技术

董占山
(中国农科院棉花所, 河南安阳, 455112)

CCDOS2.13H汉字系统的特殊显示功能可以显示24点阵的汉字和字符,及在屏幕上画点、线、矩形和圆等,给我们提供了制作中文幻灯的基本条件。下面简要介绍中文幻灯片的制作与放映技术。

一、幻灯片制作技术

一般来说,制作中文幻灯片要考虑两个方面,即文字内容与色彩调配。文字内容是指字体与字形,色彩包括前景色、背景色、标题文字色和内容文字色等,这些功能CCDOS2.13H汉字系统均提供了。
制作中文幻灯片的方法如下:首先,在CCDOS2.13H汉字系统下,用WS按2.13H汉字系统的要求编辑幻灯片的内容,然后用TYPE命令将编辑好的文件显示在屏幕上,直到满意为止。而后用《2.13系列汉字系统用户手册》上提供的屏幕图象文件的直接存取程序(pp.205-219),将屏幕上显示的幻灯片存入指定的文件,备放映幻灯片时使用。

二、幻灯片放映技术

放映幻灯片就是要在计算机屏幕上按一定的次序将制作好的幻灯片显示出来,象幻灯机一样,每放一张暂停一下,可前进可后退,也可立即停止。本人用TURBO PASCAL编写了一个幻灯片放映程序SLIDE.PAS(源程序附后),可实现上述思路。该程序使用的功能健为:Home显示第一张, PgDn显示下一张, PgUp显示上一张,End停止。显示幻灯片的程序见《2.13&127;系列汉字系统用户手册》。
  放映幻灯片的步骤:
1.建立幻灯片顺序文件:这是一个文本文件,每一行包括一个幻灯片,由幻灯片文件名和显示背景色号组成,用逗号隔开。格式如下:
DEMO1.SLD
DEMO1.G,1
DEMO2.G,4
DEMO3.G,1
DEMO4.G,0
DEMO5.G,2
背景色号0、1、2、3、4、5、6、7分别代表黑色、红色、绿色、黄色、蓝色、品红色、青色和白色。背景色是通过ANSI.SYS的扩展功能实现的, 所以在CONFIG.SYS中应当有&127;DEVICE=&127;ANSI.SYS的命令, 且ANSI.SYS应是CCDOS2.13H提供的。
2.放映幻灯片:在西文DOS系统下,执行幻灯片放映程序SLIDE,格式:
SLIDE DEMO1.SLD
上面介绍的方法在GW0520CH、GW286B等长城机上通过。

源程序清单:

{$M $1000,0,$1000}
program chinese_slide_for_GW0520CH;

uses dos;

type
sldtyp = record
flnm : string[12];
color : byte;
end;

var
flnm : string;
count,i : word;
sld : array[1..100] of sldtyp;

function readkey:char;
inline($b8/$00/$07/$cd/$21);

procedure ReadSlideFile;
var
s1 : string;
fl1 : text;

begin
assign(fl1,flnm);
reset(fl1);
if ioresult <> 0 then
begin
writeln('File not found');
halt;
end;
i := 0;
repeat
inc(i);
readln(fl1,s1);
sld[i].flnm:=copy(s1,1,pos(',',s1));
delete(s1,1,pos(',',s1));
val(s1,sld[i].color,count);
until eof(fl1);
close(fl1);
end;

procedure PlaySlide;
var
ch : char;

begin
count := 1;
repeat
ch := readkey;
if ch = #0 then
begin
ch := readkey;
if ch = #71 then count := 1;
if ch = #73 then
if count > 1 then
count := count - 1;
if ch = #81 then
if count <i then
count := count + 1
else ch := 'E';
if ch = #79 then ch := 'E';
if ch in [#71,#73,#81] then
begin
exec(getenv('COMSPEC'),' /C vsp '
+ sld[count].flnm);
case sld[count].color of
0 : writeln(chr($1b)+'[1;30;40m');
1 : writeln(chr($1b)+'[1;31;41m');
2 : writeln(chr($1b)+'[1;32;42m');
3 : writeln(chr($1b)+'[1;33;43m');
4 : writeln(chr($1b)+'[1;34;44m');
5 : writeln(chr($1b)+'[1;35;45m');
6 : writeln(chr($1b)+'[1;36;46m');
7 : writeln(chr($1b)+'[1;37;47m');
end;
writeln(chr($1b)+'[2J');
end;
end;
until ch = 'E';
end;

procedure ClearScr;
inline($b8/$03/$00 { mov ax,03}
/$cd/$10); { int 10h }

procedure GetComLineParameter;
begin
flnm := '';
if paramcount = 1 then
flnm := paramstr(1);
end;

begin
GetComLineParameter;
if flnm = '' then exit;
ReadSlideFile;
PlaySlide;
ClearScr;
end.

©董占山Zhanshan Dong

Post comments(留言)

Name(名字):

Comment(内容):


由Google提供

SunfineData Products|U's Bargain Network|Contact Me(与我联系)
© 1998-, 董占山, 版权所有, 欢迎转载文章链接。
转载文章和软件请注明出处(http://articles.sunfinedata.com/)。