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中完成打印操作是如此的輕松和簡單
新聞熱點
疑難解答