You dump a rastport (drawing area) to a graphics capable printer by
passing an iodrpreq to the device with prd_dumprport set in io_command
along with several parameters that define how the dump is to be rendered.
union printerIO *PrintIO
struct RastPort *rastPort;
struct ColorMap *colorMap;
ULONG modeid;
UWORD sx, sy, sw, sh;
LONG dc, dr;
UWORD s;
PrintIO->iodrp.io_RastPort = rastPort; /* pointer to RastPort */
PrintIO->iodrp.io_ColorMap = colorMap; /* pointer to color map */
PrintIO->iodrp.io_Modes = modeid; /* ModeID of ViewPort */
PrintIO->iodrp.io_SrcX = sx; /* RastPort X offset */
PrintIO->iodrp.io_SrcY = sy; /* RastPort Y offset */
PrintIO->iodrp.io_SrcWidth = sw; /* print width from X offset */
PrintIO->iodrp.io_SrcHeight = sh; /* print height from Y offset */
PrintIO->iodrp.io_DestCols = dc; /* pixel width */
PrintIO->iodrp.io_DestRows = dr; /* pixel height */
PrintIO->iodrp.io_Special = s; /* flags */
PrintIO->iodrp.io_Command = PRD_DUMPRPORT;
SendIO((struct IORequest *)request);
The asynchronous sendio() routine is used in this example instead of the
synchronous doio(). a call to doio() does not return until the i/o
request is finished. A call to SendIO() returns immediately. This allows
your task to do other processing such as checking if the user wants to
abort the I/O request. It should also be used when writing a lot of text
or raw data with cmd_write and prd_rawwrite.
Here is an overview of the possible arguments for the rastport dump.
io_RastPort A pointer to a rastport. the rastport's bitmap could be
in Fast memory.
io_ColorMap A pointer to a colormap. this could be a custom one.
io_Modes The viewmode flags or the ModeID returned from
GetVPModeID() (V36).
io_SrcX X offset in the RastPort to start printing from.
io_SrcY Y offset in the RastPort to start printing from.
io_SrcWidth Width of the RastPort to print from io_SrcX.
io_SrcHeight Height of the RastPort to print from io_SrcY.
io_DestCols Width of the dump in printer pixels.
io_DestRows Height of the dump in printer pixels.
io_Special Flag bits (described below).
Looking at these arguments you can see the enormous flexibility the
printer device offers for dumping a rastport. the rastport pointed to
could be totally custom defined. This flexibility means it is possible to
build a bitmap with the resolution of the printer. this would result in
having one pixel of the BitMap correspond to one pixel of the printer. In
other words, only the resolution of the output device would limit the
final result. With 12 bit planes and a custom colormap, you could dump
4096 colors - without the HAM limitation - to a suitable printer. The
offset, width and height parameters allow dumps of any desired part of the
picture. Finally the viewport mode, io_destcols, io_destrows parameters,
together with the io_Special flags define how the dump will appear on
paper and aid in getting the correct aspect ratio.
printer special flags
printing with corrected aspect ratio
strip printing
additional notes about graphic dumps