Instance Method


Retrieves the line-stroking pattern for the path.


- (void)getLineDash:(CGFloat *)pattern count:(NSInteger *)count phase:(CGFloat *)phase;



On input, a C-style array of floating point values, or nil if you do not want the pattern values. On output, this array contains the lengths (measured in points) of the line segments and gaps in the pattern. The values in the array alternate, starting with the first line segment length, followed by the first gap length, followed by the second line segment length, and so on.


On input, a pointer to an integer or nil if you do not want the number of pattern entries. On output, the number of entries written to pattern.


On input, a pointer to a floating point value or nil if you do not want the phase. On output, this value contains the offset at which to start drawing the pattern, measured in points along the dashed-line pattern. For example, a phase of 6 in the pattern 5-2-3-2 would cause drawing to begin in the middle of the first gap.


The array in the pattern parameter must be large enough to hold all of the returned values in the pattern. If you are not sure how many values there might be, you can call this method twice. The first time you call it, do not pass a value for pattern but use the returned value in the count parameter to allocate an array of floating-point numbers that you can then pass in the second time.

See Also

Accessing Drawing Properties


The line width of the path.


The shape of the paths end points when stroked.


The shape of the joints between connected segments of a stroked path.


The limiting value that helps avoid spikes at junctions between connected line segments.


The factor that determines the rendering accuracy for curved path segments.


A Boolean indicating whether the even-odd winding rule is in use for drawing paths.

- setLineDash:count:phase:

Sets the line-stroking pattern for the path.