RpPrinter:DrawRectangle() Method

<< Click to Display Table of Contents >>

Navigation:  RpPrinter & PtrDevice Class Overview > RpPrinter Class >

RpPrinter:DrawRectangle() Method

Previous pageReturn to chapter overviewNext page

Purpose

To draw a rectangle on the printer or print preview window.

Syntax

<oRpPrinter>:DrawRectangle([nFromY], [nFromX], [nToY], [nToX],

[nLineThickness], [nLineStyle], [oLineColor] , [nBkGndStyle],

[oBkGndColor])

Arguments

nFromY

Optional.  The top row of the rectangle.  The default is the current PROW setting.

nFromX

Optional. The left column of the rectangle.  The default is the current PCOL setting.

nToY

Optional.  The bottom row of the rectangle.  The default is the current PROW setting.

nToX

Optional.  The right column of the rectangle.  The default is the current PCOL setting.

nLineThickness

Optional.  The thickness of the line used to draw the rectangle (in pixels).  The default is 1.

nLineStyle

Optional.  The style of the line used to draw the rectangle.  Valid settings are the same as the Windows pen styles:  PS_SOLID, PS_DASH, PS_DASHDOT, PS_DASHDOTDOT, PS_DOT.  The default is PS_SOLID.

oLineColor

Optional.  Color object for setting the line color.  The default is Color{COLORBLACK}.

oBkGndStyle

Optional.  A manifest which represents the background style.  Valid styles are listed below.  

oBkGndColor

Optional. Color object for setting the background color.  The default is Color{COLORWHITE}

Valid BkGndStyle Values

HS_SOLID

 Solid color

HS_HOLLOW

 Hollow brush (transparent) - default

HS_BDIAGONAL

 -degree upward hatch (left to right)

HS_CROSS

 Horizontal and vertical cross-hatch

HS_DIAGCROSS

 -degree cross-hatch

HS_FDIAGONAL

 -degree downward hatch (left to right)

HS_HORIZONTAL

 Horizontal hatch

HS_VERTICAL

 Vertical hatch

Example

// Draw a rectangle of 10,10 at the current position

nPRow := oRpPrinter:PRow

nPCol := oRpPrinter:PCol

oRpPrinter:DrawRectangle(, , nPRow+10, nPCol+10)