Function

CGContextSetStrokePattern

Sets the stroke pattern in the specified graphics context.

Declaration

void CGContextSetStrokePattern(CGContextRef c, CGPatternRef pattern, const CGFloat *components);

Parameters

c

The graphics context to modify.

pattern

A pattern for stroking. the object is retained; upon return, you may safely release it.

components

If the specified pattern is an uncolored (or masking) pattern, pass an array of intensity values that specify the color to use when the pattern is painted. The number of array elements must equal the number of components in the base space of the stroke pattern color space, plus an additional component for the alpha value.

If the specified pattern is a colored pattern, pass an alpha value.

Discussion

The current stroke color space must be a pattern color space. Otherwise, the result of calling this function is undefined. If you want to set a stroke color, not a stroke pattern, use CGContextSetStrokeColorWithColor.

See Also

Getting and Setting Graphics State Parameters

CGContextGetInterpolationQuality

Returns the current level of interpolation quality for a graphics context.

CGContextSetFlatness

Sets the accuracy of curved paths in a graphics context.

CGContextSetInterpolationQuality

Sets the level of interpolation quality for a graphics context.

CGContextSetLineCap

Sets the style for the endpoints of lines drawn in a graphics context.

CGContextSetLineDash

Sets the pattern for dashed lines in a graphics context.

CGContextSetLineJoin

Sets the style for the joins of connected lines in a graphics context.

CGContextSetLineWidth

Sets the line width for a graphics context.

CGContextSetMiterLimit

Sets the miter limit for the joins of connected lines in a graphics context.

CGContextSetPatternPhase

Sets the pattern phase of a context.

CGContextSetFillPattern

Sets the fill pattern in the specified graphics context.

CGContextSetRenderingIntent

Sets the rendering intent in the current graphics state.

CGContextSetShouldAntialias

Sets antialiasing on or off for a graphics context.

CGContextSetBlendMode

Sets how sample values are composited by a graphics context.

CGContextSetAllowsAntialiasing

Sets whether or not to allow antialiasing for a graphics context.

CGContextSetAllowsFontSmoothing

Sets whether or not to allow font smoothing for a graphics context.

CGContextSetShouldSmoothFonts

Enables or disables font smoothing in a graphics context.

CGContextSetAllowsFontSubpixelPositioning

Sets whether or not to allow subpixel positioning for a graphics context.

CGContextSetShouldSubpixelPositionFonts

Enables or disables subpixel positioning in a graphics context.

CGContextSetAllowsFontSubpixelQuantization

Sets whether or not to allow subpixel quantization for a graphics context.

CGContextSetShouldSubpixelQuantizeFonts

Enables or disables subpixel quantization in a graphics context.