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

copy-area Function

Summary

Copies a rectangular area from one port to another.

Package

graphics-ports

Signature

copy-area to-port from-port to-x to-y width height from-x from-y &rest args

Arguments
to-port
A graphics port.
from-port
A graphics port.
to-x
A real number.
to-y
A real number.
width
A real number.
height
A real number.
from-x
A real number.
from-y
A real number.
args
graphics-state parameters passed as keyword arguments.
Description

The function copy-area copies a rectangular area from from-port to to-port, taking account of transformations.

In drawing-mode :compatible (old drawing mode), copy-area is exactly the same as copy-pixels.

In drawing-mode :quality (the default), copy-area copies a rectangular area from one port to another. The transform, mask, mask-transform, compositing-mode and shape-mode from to-port's graphics-state are all used, unless overridden in args. to-port and from-port need not have the same depth and can be the same object. The corners of the copied rectangle are (from-x from-y), (from-x+width from-y), (from-x+width from-y+height) and (from-x from-y+height), which are interpreted as pixel positions in the window coordinates of from-port, that is, they are not transformed by from-port's transform. The top left of the rectangle is copied to (to-x to-y) in to-port's coordinates.

Notes

The main difference between copy-area and copy-pixels in drawing-mode :quality is when copying from a displayed window.

copy-area always copies using the correct transformation of the target, but that it means that it may copy from an obscured part of the window and hence copy the wrong thing. copy-pixels generates an exposure event on the target port instead of copying obscured areas, but to do that it has to ignore the transformation.

Examples
(example-edit-file "capi/graphics/compositing-mode")
See also

copy-pixels
graphics-state
13 Drawing - Graphics Ports


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