Makes an image out of a specified rectangle of a graphics port's contents.
graphics-ports
make-image-from-port port &optional x y width height => image
port⇩ |
A graphics port. |
x⇩ |
An integer. |
y⇩ |
An integer. |
width⇩ |
An integer. |
height⇩ |
An integer. |
image |
An image. |
The function make-image-from-port
makes an image out of the specified rectangle of the port's contents. The default is the whole port, but a region can be specified by supplying x, y, width, and height. The default values of x and y is 0.
Normally the image is freed automatically, when port is destroyed. However there are circumstances where you need to explicitly free an image, for example when you want it to go away before the port. If the image is not freed, a memory leak occurs.
On macOS, port must be a pixmap-port (an error is signaled if port is an output-pane). This is also recommended for other platforms as well, because it might be impossible to get the correct pixel information from an output-pane.
CAPI User Guide and Reference Manual (Windows version) - 18 Feb 2025 15:35:52