Title Banner

Previous Book Contents Book Index Next

Newton Developer Technical Information: Newton Programmer's Guide: 2.1 OS Addendum /
Chapter 6 - Drawing and Graphics 2.1 / Drawing and Graphics Reference
Functions and Methods /


GetStrokePointsArray

GetStrokePointsArray(stroke, format)

Copies the data for all the points in an ink stroke into an array.

stroke
A binary object representing an ink stroke; see "Stroke, Word, and Gesture Units" (page 8-29) in Newton Programmer's Reference.

format
An integer or frame specifying how to format the output

Possible integer values are:

0 Data in screen resolution. Filter out duplicate points.

1 Data in screen resolution. Duplicate points are allowed.

2 Data in tablet resolution. Filter out duplicate points.

3 Data in tablet resolution. Duplicate points are allowed.

For information on the screen vs. tablet resolution distinction, see "Using Stroke Bundles" (page 10-42) in Newton Programmer's Guide.

If this parameter is a frame, it may contain the following slots:

format Required. An integer, any of the integers this parameter can accept if not supplying a frame (listed above).

distance Optional. An integer, the minimum distance between points.The default is 0. Using a value of just 1 or 2 significantly reduces the size of the array returned by this function. This is handy, as you don't have to munge through so much data if you want to analyze a stroke yourself. You can also create polygon views with reasonable fidelity using significantly fewer points. With values greater than 4, the resulting polygon looks noticeably different.

order Optional. One of the following symbols: 'xy or 'yx. The default is 'yx. This slot controls the xy ordering of the points. Normally, *GetStrokePointsArray returns the points in (y, x) order. If this slot has the value 'xy, the points are returned in (x, y) order.

return value
An array of points. This array contains an even number of elements, containing the x and y coordinates. Normally the coordinates are returned in (y,x) order, however you can control this through the order slot of the format parameter.

COMPATIBILTY

The version of this function on Newton OS versions prior to 2.1 accepts only an integer for the format parameter.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
26 APR 1997



Navigation graphic, see text links

Main | Top of Section | What's New | Apple Computer, Inc. | Find It | Feedback | Help