WINPRINT-GRAPH-BRUSH

This operation code specifies the pattern or solid color used to fill a shape drawn with WINPRINT-GRAPH-DRAW.

Usage

CALL "WIN$PRINTER"
    USING WINPRINT-GRAPH-BRUSH, 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-BRUSH REDEFINES
   WPRTDATA-SET-STD-FONT.
      05  WPRTDATA-BRUSH-STYLE        UNSIGNED-SHORT.
      05  WPRTDATA-BRUSH-COLOR        PIC 9(9) COMP-5

Return Values

This operation returns the style and color of the brush used by 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 brush specified will apply to all graphic operations until a new call is executed. The selected brush is released when the printer is closed and will not affect subsequent print jobs. WPRTDATA-BRUSH must be initialized before use. There is no limit to the number of times this operation may be called.

WINPRINT-GRAPH-BRUSH has the following values:

  • WPRTDATA-BRUSH-COLOR - Specifies the color used to fill the shape drawn with 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.
    Note: See your Windows API documentation for more information about RGB colors and COLORREF values.
  • WPRTDATA-BRUSH-STYLE - Specifies the pattern used to fill the shape drawn with WINPRINT-GRAPH-DRAW. It may be set to one of the following values:
    WPRT-BRUSH-SOLID Selects a solid brush that fills the shape with the color selected in WPRTDATA-BRUSH-COLOR.
    WPRT-BRUSH-NULL (default) The shape is not filled, and the background layer will show through.
    WPRT-BRUSH-BDIAGONAL Fills the shape with a pattern of lines angled at 45-degrees. (//////)
    WPRT-BRUSH-CROSS Fills the shape with a pattern of crosses. (++++++)
    WPRT-BRUSH-DIAGCROSS Fills the shape with a pattern of diagonal crosses. (xxxxxx)
    WPRT-BRUSH-FDIAGONAL Fills the shape with a pattern of lines angled at –45-degrees. (\\\\\\)
    WPRT-BRUSH-HORIZONTAL Fills the shape with a pattern of dashes. (------)
    WPRT-BRUSH-VERTICAL Fills the shape with a pattern of vertical bars. (||||||)
    WPRT-BRUSH-DKGRAY Fills the shape with solid dark gray. If color is specified, it is ignored.
    WPRT-BRUSH-GRAY Fills the shape with solid gray. If color is specified, it is ignored.
    WPRT-BRUSH-LTGRAY Fills the shape with solid light gray. If color is specified, it is ignored.

Example

See graphprn.cbl for examples of printing graphics. This example will fill the shapes drawn with solid gray:

INITIALIZE WPRTDATA-BRUSH.
MOVE WPRT-BRUSH-GRAY  TO  WPRTDATA-BRUSH-STYLE.

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