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

get-origin Function

Summary

Returns the coordinate origin of a pixmap graphics port.

Package

graphics-ports

Signature

get-origin pixmap-port => x, y

Arguments
pixmap-port
A graphics port.
Values
x
An integer.
y
An integer.
Description

The function get-origin returns the coordinate origin or pixmap-port. Normally this is (0 0) but after a series of drawing function calls with :relative t, the drawing may have been shifted. The values returned by get-origin tell you by how much. The values are not needed when making images from the port's drawing.

Examples
(with-pixmap-graphics-port (p1 pane width height :relative t)
    (with-graphics-rotation (p1 0.123)
      (draw-rectangle p1 0 0 200 120 :filled t
                                       :foreground :red)
      (get-origin p1)))   

produces:

-15
0

CAPI User Guide and Reference Manual (Windows version) - 01 Dec 2021 19:34:15