Binds the graphics state values of a port to a list of arguments and executes a body of code.
with-graphics-state ( port &rest args &key transform foreground background operation thickness scale-thickness dashed dash line-end-style line-joint-style mask font state fill-style stipple pattern mask-x mask-y shape-mode text-mode compositing-mode mask-transform ) body => result
The macro with-graphics-state
binds the graphics state values for the specified port to the values specified in the
args
list. The keyword arguments
args
correspond to the slots in the graphics state, as described in graphics-state.
(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. The argument 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.
An extra keyword argument :state
can be used. The value must be a graphics-state object created by a call to make-graphics-state. The contents of the graphics-state object passed are used instead of the
port
's state.
(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
Drawing - Graphics Ports
CAPI User Guide and Reference Manual (Unix version) - 25 Feb 2015