GRAPHIC PAINT statement  

Purpose

Fill an area with a solid color or a hatch pattern.

Syntax

GRAPHIC PAINT [BORDER | REPLACE] [STEP] (x!, y!) [, [rgbFill&] [, [rgbBorder&] [, [fillstyle&]]]]

Remarks

The coordinate points are specified in Page Units.

x!, y!

The point where filling begins. If the STEP option is included, the x and y coordinates are relative to the last point referenced (POS) in the selected graphic target.

rgbFill&

Optional RGB color value for the fill area.  If rgbFill& is omitted (or -1), the default foreground color is used.

rgbBorder&

Optional RGB base color of the fill area.  If the REPLACE option is chosen, filling continues outward in all directions until a color other than rgbBorder& is found.  If the BORDER option (or no option) is included, filling continues outward until the rgbBorder& color is found.  If rgbBorder& is not specified, it is assumed to be the same as the rgbFill& parameter.

fillstyle&

Optional fill style (pattern) to use.  If fillstyle& is omitted, the default fill style is solid (0).  If a hatch pattern is chosen (1 to 6), the foreground color is specified by the rgbFill&, while the background is specified by the default background color for the selected graphic target. The optional fillstyle& may be:

0

Solid (default)

1

Horizontal Lines

2

Vertical Lines

3

Upward Diagonal Lines

4

Downward Diagonal Lines

5

Crossed Lines

6

Diagonal Crossed Lines

See also

Built In RGB Color Equates, GRAPHIC ARC, GRAPHIC ATTACH, GRAPHIC BOX, GRAPHIC COLOR, GRAPHIC ELLIPSE, GRAPHIC LINE, GRAPHIC PIE

Example

FUNCTION PBMAIN

  LOCAL hWin AS DWORD

 

  GRAPHIC WINDOW "Paint", 0, 0, 200, 200 TO hWin

  GRAPHIC ATTACH hWin, 0

 

  ' Draw a circle with blue foreground color

  ' and a box below it with red foreground color.

  GRAPHIC ELLIPSE (10, 10) - (70, 70), %BLUE

  GRAPHIC BOX (10, 80) - (70, 120), 0, %RED

 

  ' Fill the area inside the circle's blue borders

  ' with a green diagonal pattern.

  GRAPHIC PAINT BORDER (40, 40), %GREEN, %BLUE, 6

 

  'Retrieve the color at point 5,5 (outside the circle).

  GRAPHIC GET PIXEL (5, 5) TO lRes&

 

  ' Fill the area outside the circle by replacing the color

  ' at point 5,5 and outwards with a solid yellow color.

  GRAPHIC PAINT REPLACE (5, 5), RGB(255, 255, 223), lRes&, 0

 

  SLEEP 10000

END FUNCTION