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

Creates and prints raster images


Syntax
hpRaster( <aArray>, <nRow>, <nCol>, [<nResolution> ;
   [, <cUnits> [, <cDirection>]]])


Parameters

<aArray>
The array which defines the raster image.

<nRow>
The vertical distance from the top margin to print the raster image.

<nCol>
The horizontal distance from the left margin to print the raster image.

<nResolution>
The printer resolution to print the raster image at. Valid
values for <nResolution> are expressed as dots per
inch and can be any of the following:
75      75 dots per inch
150     150 dots per inch
300     300 dots per inch
If <nResolution> is omitted, it will be defaulted to 300.

<cUnits>
The units of measurement to used for positioning. Valid
values for <cUnits> are:
"R"     Rows and Columns
"I"     Inches
"M"     Millimeters
If <cUnits> is omitted, the units will default to Rows and Columns.

<cDirection>
Specifies a rotation or flip, if any, to be applied to the raster image.
Valid values for <cDirection> are:
"N"     Normal - print the raster normally
"U"     Upside down - rotate the raster 180 degrees
"R"     Right - rotate the raster 90 degrees clockwise
"L"     Left - rotate the raster 90 degress counter-clockwise
"H"     Horizontal - flip around the horizontal axis
"V"     Vertical - flip around the vertical axis

Returns

0
Successful.

-17
Invalid parameter type was passed.


Remarks

To create truly attractive and useful output, you may need to incorporate
small graphic images such as bullets, check marks, or arrows onto your
page.  Sometimes the images you desire can be found in one of the
characters in the symbol set.  If not, the small image can most likely be
created using hpRaster().  Simply define the image as an array.  Then,
pass the array as a parameter to hpRaster(), and the raster image will
be created and printed just where you want it.

Note: Raster graphics require a large amount of memory. This function
is designed for creating small raster images (less than 1/4" around). If
large raster images are attempted, unpredictable results may occur.


Support By

All HP LaserJet Printers


Example

To create and print a bullet:

LOCAL aBullet := {"          ******* ",;
                  "        *********** ",;
                  "      *************** ",;
                  "     ***************** ",;
                  "    ******************* ",;
                  "   ********************* ",;
                  "  *********************** ",;
                  "  *********************** ",;
                  "  *********************** ",;
                  " ************************* ",;
                  " ************************* ",;
                  " ************************* ",;
                  " ************************* ",;
                  " ************************* ",;
                  " ************************* ",;
                  " ************************* ",;
                  "  *********************** ",;
                  "  *********************** ",;
                  "  *********************** ",;
                  "   ********************* ",;
                  "    ******************* ",;
                  "     ***************** ",;
                  "      *************** ",;
                  "        *********** ",;
                  "          ******* "}
hpPrintOn( )
hpConfig()
hpSetFont()
hpRaster(aBullet, 10, 10)
hpAtSay(10, 12, 'This line is bulleted at row 10')
hpReset( )
hpPrintOff( )

Note:  Notice that the bullet above is elongated.  This is because a cell
on the screen is taller than it is wide.  Because of this, designing the
array which defines the raster image can be difficult.  One solution to
this problem, which is almost always worth the effort , is to first draw
the image onto graph paper.  Once the image is defined on graph paper,
creating the array is a breeze.  To create more complex raster images,
try creating the image first in a graphics program and then print it on
graph paper.

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