Generic FunctionPackage: cgToCDocOverviewCGDocRelNotesFAQIndexPermutedIndex
Allegro CL version 8.1
Unrevised from 8.0 to 8.1.
8.0 version

draw-ellipse

Arguments: stream center semi-major-axis semi-minor-axis semi-major-axis-angle

Draws an ellipse on stream. The ellipse is defined by the center (a position) and the two half-axes, lengths from the center to the farthest point on the edge and to the nearest point on the edge, called the semi-major-axis and the semi-minor-axis. (Technically, the major axis should be longer than the minor axis but the two arguments need not have that relationship.) Because the Windows ellipse drawer can only draw ellipses that are vertically or horizontally oriented, the semi-major-axis-angle argument must be a multiple of 90. Other values will signal an error. The argument specifies the angle between the semi-major-axis and a line parallel to the x-axis passing through the center. Angles are measured clockwise.

center should be a position (see make-position). stream should be a cg-stream.

The following example creates a window that draws a thin vertically-oriented ellipse that is 200 pixels tall and has a line-width of 3 pixels:

(defclass ellipse-window (frame-window)()
  (:default-initargs
   :exterior (make-box-relative 100 100 100 400)
   :title "Ellipse"))

(defmethod redisplay-window ((window ellipse-window) 
                             &optional clipping-box)
  (declare (ignore clipping-box))
  (call-next-method)   ;; Draw the background
  (with-line-width (window 3)
    (draw-ellipse window (make-position 50 150) 100 20 90)))

(make-window :ellipse-example :class 'ellipse-window)

See also cg-drawing.htm.


Copyright (c) 1998-2009, Franz Inc. Oakland, CA., USA. All rights reserved.
Documentation for Allegro CL version 8.1. This page was not revised from the 8.0 page.
Created 2009.7.29.

ToCDocOverviewCGDocRelNotesFAQIndexPermutedIndex
Allegro CL version 8.1
Unrevised from 8.0 to 8.1.
8.0 version