首页 > 设计 > 媒体动画 > 正文

Authorware类和函数:在AUTHORWARE里面灵活完成打印操作

2020-09-19 18:45:33
字体:
来源:转载
供稿:网友

   authorware是广大多媒体爱好者广泛使用的制作软件之一,因为它不需要专业的编程知识,仅需按照流程框图即可制作出专业的多媒体作品来,因而深受各多媒体设计者的青睐。
  在authorware中,为了使制作出来的多媒体作品功能更加完善,往往要加入打印功能,而authorware并不提供完善的打印支持,此时,就需要使用到外部的打印函数。下面,我将就authorware中应用得较多的打印函数prnt.u32作一个全面的介绍。
   prnt函数(其中prnt.ucd是16位的用户函数,prnt.u32是32位的用户函数)是authorware的一个外部函数,在使用之前,需要先行装载,如图1所示。
   值得注意的是,在使用prnt之前,必须先使用prntopen函数以将打印机打开;在打印完成后,必须使用prntclose函数以关闭打印机。
   prnt函数中一共包括有十来个函数,分别介绍如下:
   函数:prntfile
   语法:result = prntfile(filename)
   功能:使用此函数可以用以打印一个文本文件。其中filename为待打印文件的文件名。
  函数:prntopen
   语法:result = prntopen(window handle, left margin, top margin, orientation)
  功能:该函数用于打开系统缺省的打印机。其中left margin和top margin是左边和上边的空白距离,单位为0.1英寸(亦即10=1inch);orientation可设定打印方向,为1则横向,为0则纵向。
  函数:prntstring
   语法:result = prntstring( string to print)
   功能:打开指定的字符串。其中string to print为指定的字符串(要使用双引号引起来)。
  函数:prntclose
  语法:result = prntclose( )
  功能:关闭打印机。
  函数:prntfont
  语法:result = prntfont(font face, font size )
  功能:该函数用于设定打印的字体和字号。
  函数:prntscrn
  语法:result = prntscrn(screen left, screen top, screen width,screen height, print left, print top, print width, print height)
  功能:该函数将打印指定的部分屏幕区域。其中screen left、screen top、screen width、screen height分别指定了屏幕区域的大小;print left、print top、print width、print height分别指定了打印纸上的具体打印位置。
  函数:prntdib
  语法:result = prntdib(filename, print left, print right, print width, print height)
  功能:在指定的打印区域中打印位图或位图序列。
  函数:prntline
  语法:result = prntline(x start pos, y start pos, x end pos, y end pos, width)
  功能:打印线条。其中x start pos和y start pos分别指定了线条的x轴和y轴起点;x end pos和y end pos分别指定了线条的x轴和y轴终点;width指定了线条的粗细。它们的单位是0.1英寸。
  函数:prntrect
  语法:result = prntrect(left, top, right, bottom, width)
  功能:打印矩形或正方形。其中left、top、right、bottom、width分别指定了矩形或正方形的各顶点位置和线条粗细。它们的单位是0.1英寸。
  函数:prntellipse
  语法:result = prntellipse(left, top, right, bottom, width)
  功能:打印椭圆或圆。其中left、top、right、bottom、width分别决定了椭圆或圆的大小及线条粗细。它们的单位是0.1英寸。
  函数:prntrrect
  语法:result = prntrrect(left, top, right, bottom, width, corner ellipse width, cornerellipse height)
  功能:打印圆角矩形。其中left、top、right、bottom、width分别决定了圆角矩形的大小;corner ellipse width、corner ellipse height分别决定了矩形的圆角程度。
  了解了prnt.u32中的上述函数,你是否发现,在authorware中完成打印操作是如此的轻松和简单

发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表