Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Sunshow Pro V3.0 - <b>canongif()</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
CanonGIF()

Prints a Compuserve GIF image file on an Canon Bubble Jet or compatible printer


Syntax

CanonGIF(<cFILENAME.GIF>, <cDevStr>, <nDPI>, <nLeft>, ;
   <nTop>, <nNewWidth>, <nNewHeight>, <nBrightness>, ;
   <nPageSize>, [<nOptions>])


Arguments

<cFILENAME.GIF>
Name of the GIF image file, and optional drive and path.

<cDevStr>
Output device string:"lpt<n>", "com<n>", "prn", "file:<FILE>".

<nDPI>
Dots per inch to print at (360, 180, 60).

<nLeft>
Left offset into the page in inches.

<nTop>
Top offset into the page in inches.

<nNewWidth>
New print width in inches.

<nNewHeight>
New print height in inches.

<nBrightness>
Change brightness value between -255 dark to 255 light. 
Suggested value: 60.

<nPageSize>
Set page height in inches (11", 14", or 17").

<nOptions>
FORMFEED, FASTFLAG.


Returns

0
Success.

-1
Cannot open <cFILENAME.GIF>.

-2
Cannot allocate memory for line buffers.

-3
This is not a GIF file.

-4
Print terminated by user.

-5
Printer does not acknowledge.

-6
Printer is out of paper.

-7
Printer timeout error.

-8
GIF file is interlaced, so cannot be printed.

-9
<cDevStr> must be "lpt<n>", "com<n>", "prn", "file:<FILE>".

-10
<nDPI> must be 360, 180, or 60.

-11
<nLeft> plus <nNewWidth> must be less than 11.0".

-12
<nTop> plus <nNewHeight> must be less than 17.0".

-13
<nBrightness> should be between -255 and 255.

-14
<nPageSize> should be 11", 14", or 17".

-99
Parameters are invalid.


Remarks

CanonGIF() prints a GIF image on Canon BJC-800 and BJC-820 Color Bubble 
Jet printers. Form feed disabling and fastflag are optional. You must set 
brightness, port, or file. CanonGIF() has the capability of printing 
enormous images larger than screen sizes to 2550x3300 pixels.

Canon BJC-800 and BJC-820 Color Bubble Jet printer supports cut sheet, 
plain and coated paper, envelopes, and transparencies up to 11.7" x 17.0". 
The Canon BJC-800 has a Centronics parallel interface, with an optional, 
separate SCSI board available, while the BJC-820 has both Centronics 
parallel and SCSI interfaces. Sunshow Pro currently does not support the 
SCSI interfaces. Epson LQ-2550, LQ-Color, LQ-1050 (monochrome only), and 
LQ-850 (monochrome only) emulations are available. Plain paper is suitable 
for text only, coated paper is required for maximum presentation quality, 
especially for images. Canon accepts A4, A3, letter, legal, and ledger size 
paper.


Example

To print ASMUSSEN.GIF 4.0" x 3.0" at 360 dpi with a left margin of 1.75 
inches and a top margin of 3.5 inches in the approximate center of the page:

cFILENAME = "ASMUSSEN.GIF"
nStatus = CanonGIF(cFILENAME, "lpt1", 360, 1.75, 3.5, 4, ;
    3, 60, 11, FASTFLAG + FORMFEED)
IF nStatus < 0
    DO CASE
    CASE nStatus = -1
        ? "Cannot open", cFILENAME
    CASE nStatus = -2
        ? "Cannot allocate memory for line buffers"
    CASE nStatus = -3
        ? cFILENAME, " is not a CompuServe GIF file"
    CASE nStatus = -4
        ? "Print terminated by user"
    CASE nStatus = -5
        ? "Printer does not acknowledge"
    CASE nStatus = -6
        ? "Printer is out of paper"
    CASE nStatus = -7
        ? "Printer timeout error"
    CASE nStatus = -8
        ? "Cannot print an interlaced GIF file"
    CASE nStatus = -9
        ? "cDevStr must be lpt<N>, com<N>, prn, " + ;
          "file:<FILE>"
    CASE nStatus = -10
        ? "nDPI must be 360, 180, or 60"
    CASE nStatus = -11
        ? "nLeft plus nNewWidth must be less than 11.0"
    CASE nStatus = -12
        ? "nTop plus nNewHeight must be less than 17.0"
    CASE nStatus = -13
        ? "nBrightness should be between -255 and 255"
    CASE nStatus = -14
        ? "nPageSize should be 11, 14, or 17"
    CASE nStatus = -99
        ? "Parameters are invalid"
    ENDCASE
    RETURN
    ENDIF

For other examples of how to use the image printing functions, see 
SUNPRINT.PRG, an example program distributed with Sunshow Pro.



See Also: CanonPCX() CanonSCR()

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson