Raster Graphics
2-39
With operation modes 1 and 2, the SIMG command addresses the transparency of the
source image only. For operation mode 1, the white pixels of the source image do not
overlay on the destination. For example, you cannot pattern a character. With operation
mode 2, the SIMG command applies the white pixels of the source image onto the desti-
nation directly.
The following program example illustrates use of the SIMG command. Try changing the
value specified for SIMG on line 3 and see the effect on the result (the figure on the pre-
vious page).
!R! RES; UNIT C;
NEWP;
SIMG 3; CMNT Try changing this value;
PMZP 5, 15;
PMRP 2, 2;
PDRP 0, -2, 2, 0, 0, 2, -2, 0;
PDRP -2, 0, 0, 2, 2, 0, 0, -2;
FILL 1;
SFNT ’TimesNewRoman’, 90;
PMRP -1.2, 1;
GPAT .6;
TEXT ’A’;
FILL 1;
PAGE;
EXIT;
Saving and Restoring the Graphics State
The graphics state consists of a variety of items that affect how images are rendered on
the page. The graphics state contains various information related to path mode graphics
and raster mode graphics.
Items included in the graphics state include the following:
• Current path and cursor position (if defined)
• Current pen diameter (line width)
• Current line join type
• Current line cap type
• Current miter limit
• Current dash pattern
• Current flatness
• Current fill pattern (16
× 16 dots)
• Current clipping rectangle
• Current raster resolution
• Current image model
While working with graphics, there often are occasions when it is useful to save the
graphics state, then later to restore it. One such situation occurs when a path must be
used for both stroking and filling.
3 Transparent Transparent
4 Transparent Opaque
5 Opaque Transparent
6 Opaque Opaque