WINPRINT-GRAPH-PEN

This operation code specifies characteristics of the pen used to draw a shape with WINPRINT-GRAPH-DRAW.

Usage

CALL "WIN$PRINTER"
    USING WINPRINT-GRAPH-PEN, WINPRINT-DATA
    GIVING RESULT

Parameters

WINPRINT-DATA Group item defined in winprint.def as follows:
01 WINPRINT-DATA.
   03 WPRTDATA-SET-STD-FONT.
   03  WPRTDATA-PEN REDEFINES
   WPRTDATA-SET-STD-FONT.
      05  WPRTDATA-PEN-STYLE          UNSIGNED-SHORT.
      05  WPRTDATA-PEN-WIDTH          UNSIGNED-SHORT.
      05  WPRTDATA-PEN-COLOR          PIC 9(9) COMP-5.

Return Values

This operation returns the characteristics of lines drawn with WINPRINT-GRAPH-DRAW.

Description

The printer must be open to perform this operation. It must be called prior to WINPRINT-GRAPH-DRAW. Once executed, the pen specified will apply to all graphic operations until a new call is executed. The selected pen is released when the printer is closed and will not affect subsequent print jobs. WPRTDATA-PEN must be initialized before use. There is no limit to the number of times this operation may be called.

WINPRINT-GRAPH-PEN has the following values:

WPRTDATA-PEN-WIDTH Specifies the thickness of the line drawn using WINPRINT-GRAPH-DRAW. The default unit of measure is pixels. For example, if WPRTDATA-PEN-WIDTH is set to 0, the width will be one pixel, unless another unit of measure has been selected. The default value is 1.

The actual size of this measurement is affected by the target printer's resolution. This means that a width of 5 will appear differently on a printer with a resolution of 300 dots-per-inch (DPI) than it will on a printer with 600dpi. Consider the unit of measure relative to the resolution of the targeting printer before printing.

WPRTDATA-PEN-COLOR Specifies the color of a line drawn using WINPRINT-GRAPH-DRAW. The color resolution (COLORREF) is a combination of Red, Green, and Blue (RGB). The intensity of each color in the mix is determined by a number between 0 and 255. The default color (0,0,0) is black.

See your Windows API documentation for more information about RGB colors and COLORREF values.

WPRTDATA-PEN-STYLE Specifies the type of line drawn. It may be set to one of the following values:
WPRT-PEN-SOLID (default) Draws a solid line in the color selected in WPRTDATA-BRUSH-COLOR.
WPRT-PEN-NULL Draws an invisible line. The background layer will show through.
WPRT-PEN-DASH Draws a line of dashes (------). WPRTDATA-PEN-WIDTH must equal 1 to use this style.
WPRT-PEN-DOT Draws a line of dots (......). WPRTDATA-PEN-WIDTH must equal 1 to use this style.
WPRT-PEN-DASHDOT Draws a line of alternating dashes and dots (-.-.-.-.-.-.). WPRTDATA-PEN-WIDTH must equal 1 to use this style.
WPRT-PEN-DASHDOTDOT Draws a line of dashes followed by two dots, (-..-..-..-..-..-..). WPRTDATA-PEN-WIDTH must equal 1 to use this style.
WPRT-PEN-INSIDEFRAME Draws a solid line inside of the actual geometric area of the shape.

Example

See graphprn.cbl for examples of printing graphics. This example will draw lines and shapes with a solid pen that is 10 pixels thick:

INITIALIZE WPRTDATA-PEN.
MOVE WPRT-PEN-SOLID  TO  WPRTDATA-PEN-STYLE.
MOVE 10  TO  WPRTDATA-PEN-WIDTH.

CALL "WIN$PRINTER"  
    USING  WINPRINT-GRAPH-PEN, WINPRINT-DATA
    GIVING  CALL-RESULT.