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

with-graphics-mask Macro

Summary

Binds the mask slot of a port's graphics state across the execution of a body of code.

Package

graphics-ports

Signature

with-graphics-mask (port mask &key mask-x mask-y mask-transform) &body body => result

Arguments
port
A graphics port.
mask
nil or a list specifying a shape.
mask-x, mask-y
Integers. These arguments are deprecated.
mask-transform
nil, t, the keyword :dynamic, or a transform.
body
A body of Lisp code.
Values
result
The return value of the last form executed in body.
Description

The macro with-graphics-mask binds the mask slot of port's graphics-state while evaluating the forms in body as an implicit progn. The mask can be a rectangular area specified by a list of the form (x y width height) or a path specified by a list of the form (:path path :fill-rule fill-rule).

mask-x and mask-y are deprecated. They work only when the drawing-mode is :compatible and the platform is GTK+ or X11/Motif. By default, mask-x and mask-y are both 0.

MASK-TRANSFORM is used to set the mask-transform graphics state parameter. If mask-transform is nil, then mask will not not transformed. If mask-transform is t, then mask will be transformed by the current graphics state transform at the time that with-graphics-mask is used. If mask-transform is :dynamic, then mask will be transformed by the graphics state transform that is in effect when the drawing operation uses the mask. Otherwise mask-transform should be a transform object. The default value of mask-transform is nil.

Notes

See graphics-state for more details about mask and mask-transform.

Examples

This example file demonstrates the use of mask-transform:

(example-edit-file "capi/graphics/paths")
See also

graphics-state
13.3 Graphics state


CAPI User Guide and Reference Manual (Windows version) - 01 Dec 2021 19:34:15