Binds a port to a new pixmap graphics port for the duration of the macro's code body.
graphics-ports
with-pixmap-graphics-port (port pane width height &key background foreground collect relative clear drawing-mode) &body body => result
port⇩ |
A graphics port. |
pane⇩ |
An output pane. |
width⇩ |
An integer. |
height⇩ |
An integer. |
background⇩ |
A color specification, or nil . |
foreground⇩ |
A color specification, or nil . |
collect⇩ |
A boolean. |
relative⇩ |
A boolean. |
clear⇩ |
A list or t . |
drawing-mode⇩ |
One of the keywords :compatible and :quality . |
body⇩ |
A body of Lisp code. |
result |
The return value of the last form executed in body. |
The macro with-pixmap-graphics-port
binds port to a new pixmap graphics-port.
pane, width, height, background, foreground, collect, relative, clear AND drawing-mode are used as specified by create-pixmap-port. The forms in body are then evaluated as an implicit progn. port is destroyed when body returns.
In the code below the background in p2 inherits from p1, so it draws two green rectangles.
(let ((op (capi:contain (make-instance 'capi:output-pane :background :red)))) (sleep 0.1) (gp:with-pixmap-graphics-port (p1 op 20 30 :background :green :clear t) (gp:with-pixmap-graphics-port (p2 p1 20 30 :clear t) (gp:copy-pixels op p1 10 10 20 30 0 0) (gp:copy-pixels op p2 10 60 20 30 0 0))))
CAPI User Guide and Reference Manual (Windows version) - 01 Dec 2021 19:34:15