All Manuals > CAPI User Guide and Reference Manual > 22 GRAPHICS-PORTS Reference Entries

clear-rectangle Function

Summary

Draws a rectangle in the port's background color. This function is deprecated.

Package

graphics-ports

Signature

clear-rectangle port x y width height

Arguments
port
A graphics port.
A real number.
A real number.
width
A real number.
height
A real number.
Description

The function clear-rectangle (deprecated) draws the rectangle specified by x, y, width, and height in port using the port's background color. All other graphics-state parameters are ignored.

clear-rectangle is deprecated because it ignores the graphics state args, which means it does not work properly with other drawing functions. In particular, it does not work properly in the display-callback of output-pane.

Use instead:

(draw-rectangle pane x y width height
                :filled t
                :foreground color
                :compositing-mode :copy
                :shape-mode :plain)

compositing-mode is needed only when the color has alpha.

foreground is needed only if it is different from the foreground in the graphics state.

Note that draw-rectangle does take into account the transformation in the graphics-state.

See also

draw-rectangle
13 Drawing - Graphics Ports


CAPI User Guide and Reference Manual (Unix version) - 01 Dec 2021 19:33:02