beautypg.com

Shape-based graphics 13 – Apple Newton Programmer’s Newton 2.0 (for Newton 2.0) User Manual

Page 528

background image

C H A P T E R 1 3

Drawing and Graphics

13-2

About Drawing

Note that for all of the functions described in this chapter:

The coordinates you specify are interpreted as local to the view in which the
object is drawn.

The origin of the coordinate plane (0,0) is the upper-left corner of the view in
which the object is drawn.

Positive values are towards the right or the bottom of the screen from the origin.
For additional information on the Newton coordinate system see “Coordinate
System” (page 3-6).

Shape-Based Graphics

13

Newton system software provides functions for drawing primitive graphic objects
in a view. These drawing functions return a data structure called a shape that is
used by the drawing system to draw an image on the screen. The drawing system
supports the following shape objects:

lines

rectangles

rounded rectangles

ovals (including circles)

polygons

wedges and arcs

regions

text

pictures

bitmaps

Complex graphics can be drawn by passing arrays of shapes to the various drawing
functions. Primitive shapes can be combined procedurally by collecting them into a
shape called a picture. The appearance will be the same except that, when drawn,
the picture will not be affected by any style specifications. The styles are recorded
into the picture when you make it with

MakePict

—with the exception of any

transform or clipping slot. See “Controlling Clipping” (page 13-12) and
“Transforming a Shape” (page 13-13) for more information.

Each type of shape is described in the following pages.

A line is defined by two points: the current

x

and

y

location of the graphics pen and

the

x

and

y

location of its destination. The pen hangs below the right of the defining

points, as shown in Figure 13-1, where two lines are drawn with two different
pen sizes.