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

create-pixmap-port Function

Summary

Creates a pixmap port and its window system representation.

Package

graphics-ports

Signature

create-pixmap-port port width height &key background foreground collect relative clear drawing-mode => pixmap-port

Arguments
port
A graphics port for a window.
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.
Values
pixmap-port
A pixmap graphics port.
Description

The function create-pixmap-port creates a pixmap port pixmap-port and its window system representation. port specifies the color-user, used for color conversions, and its representation may also be used by the library to match the pixmap port properties. pixmap-port will have dimensions width, height and will use the specified drawing-mode.

background and foreground are used to initialize the graphics-state-background and graphics-state-foreground of pixmap-port. If background or foreground are nil then the corresponding color from port is used.

If clear is t, then pixmap-port is cleared to its background color, otherwise the initial colors will be non-deterministic. If clear is a list of the form (x y width height), only that part of pixmap-port is cleared initially. The default value is nil.

If relative is non-nil, then pixmap-port collects pixel coordinates corresponding to the left, top, right, and bottom extremes of the drawing operations taking place within the body forms, and if these extend beyond the edges of pixmap-port (into negative coordinates for example) the entire drawing is offset by an amount which ensures it remains within the port. It is as if the port moves its relative origin in order to accommodate the drawing. If the drawing size is greater than the screen size, then some of it is lost. The default value is nil.

If collect is non-nil, this causes the drawing extremes to be collected but without having the pixmap shift to accommodate the drawing, as relative does. The extreme values can be read using the get-bounds function. The default value of collect is relative.

When pixmap-port is no longer needed, it should be destroyed by calling destroy-pixmap-port. Alternatively, use with-pixmap-graphics-port to create and destroy the port within a dynamic extent.

See also

get-bounds
destroy-pixmap-port
with-pixmap-graphics-port
13 Drawing - Graphics Ports


CAPI User Guide and Reference Manual (Macintosh version) - 01 Dec 2021 19:31:44