Binds the graphics state values of a port to a list of arguments and executes a body of code.
graphics-ports
with-graphics-state (port &rest args &key state transform foreground background operation stipple pattern fill-style thickness scale-thickness dashed dash line-end-style line-joint-style mask mask-x mask-y font shape-mode text-mode compositing-mode mask-transform) body => result
port⇩ |
A graphics port. |
args⇩ |
Keywords and values to initialize a graphics-state. |
state⇩ |
A graphics-state or nil . |
See graphics-state for interpretation of the arguments. | |
body⇩ |
A body of Lisp code. |
result |
The return value of the last form executed in body. |
The macro with-graphics-state
binds the graphics state values for port according to the values of the keyword arguments transform, foreground, background, operation, stipple, pattern, fill-style, thickness, scale-thickness, dashed, dash, line-end-style, line-joint-style, mask, mask-x, mask-y, font, shape-mode, text-mode, compositing-mode and mask-transform. Unspecified keywords leave the associated slots unchanged. The keyword arguments args correspond to the slots in the graphics state, as described in graphics-state.
If state is non-nil then the graphics-state of port is bound to it before the other keywords are processed.
The forms in body are evaluated as an implicit progn with the new graphics stare bound to port.
For example:
(with-graphics-state (port :thickness 12 :foreground my-color) ...)
Arguments that are not supplied default to the current state of that slot in the graphics-state. stipple is used only on X11/Motif.
mask-x and mask-y are deprecated. They work only when the drawing-mode is :compatible
and the platform is GTK+ or X11/Motif.
(setf gstate (make-graphics-state)) (setf (graphics-state-foreground gstate) my-color) (with-graphics-state (port :state gstate) (draw-rectangle port image-1 100 100))
graphics-state
set-graphics-state
with-graphics-translation
with-graphics-post-translation
with-graphics-scale
with-graphics-rotation
with-graphics-transform
with-graphics-transform-reset
with-graphics-mask
13 Drawing - Graphics Ports
CAPI User Guide and Reference Manual (Macintosh version) - 01 Dec 2021 19:31:44