Instance Method

initWithPatternImage:

Creates a color object using the specified image object.

Declaration

- (UIColor *)initWithPatternImage:(UIImage *)image;

Parameters

image

The image to use when creating the pattern color.

Return Value

The pattern color.

Discussion

You can use pattern colors to set the fill or stroke color just as you would a solid color. During drawing, the image in the pattern color is tiled as necessary to cover the given area.

By default, the phase of the returned color is 0, which causes the top-left corner of the image to be aligned with the drawing origin. To change the phase, make the color the current color and then use the CGContextSetPatternPhase function to change the phase.

See Also

Creating a Pattern-Based Color

+ colorWithPatternImage:

Creates a color object using the specified image.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software