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

NextPrevUpTopContentsIndex

with-graphics-rotation

with-graphics-scale

with-graphics-translation

Macros
Summary

Combines a transformation (rotation, scaling or translation) with the transform of a port for the duration of the macro.

Package

graphics-ports

Signature

with-graphics-rotation ( port angle ) &body body => result

with-graphics-scale ( port sx sy ) &body body => result

with-graphics-translation ( port dx dy ) &body body => result

Arguments

port

A graphics port.

angle

A real number.

sx, sy

Real numbers.

dx, dy

Real numbers.

body

A body of Lisp code.

Values

result

The return value(s) of the last form executed in body .

Description

These macros combine the transform associated with the graphics port with an additional transform during the body of the macro. The port is given a new transform obtained by pre-multiplying its current transform with the transform that the macro creates.

with-graphics-rotation creates a transformation that rotates with angle radians. If angle is positive, then the rotation is clockwise.

with-graphics-scale creates a transformation that scales by sx and sy in the X and Y dimensions.

with-graphics-translation creates a transformation that translates by dx and dy in the X and Y dimensions.

Notes
  1. These macros do the same as with-graphics-transform does with an appropriate transform.
  2. The transform associated with a graphics port is part of the port's graphics state. See graphics-state for details.
Examples
(example-edit-file "capi/graphics/catherine-wheel")
See also

graphics-state
with-graphics-post-translation
with-graphics-transform
Graphics state transforms
Setting the graphics state


CAPI User Guide and Reference Manual (Macintosh version) - 25 Feb 2015

NextPrevUpTopContentsIndex