Derived from | |
Framework | ApplicationServices/ApplicationServices.h |
Companion guide | |
Declared in | CGShading.h |
CGShadingRef
is an opaque type used to define linear (axial) and radial gradient fills whose color transitions are controlled by a function (CGFunctionRef
) that you provide. Shading means to fill using a smooth transition between colors
across an area. To paint with a Quartz shading, you call CGContextDrawShading
.
This function fills the current clipping path using the specified
color gradient, calling your parametric function repeatedly as it
draws
An alternative to using a CGShading object is to use the CGGradientRef
opaque type. For applications that run in Mac OS X v10.5 and later, CGGradient objects are much simpler to use. (See CGGradient Reference.)
Creates a shading object to use for axial shading.
CGShadingRef CGShadingCreateAxial ( CGColorSpaceRef colorspace, CGPoint start, CGPoint end, CGFunctionRef function, bool extendStart, bool extendEnd );
The color space in which color values are expressed. Quartz retains this object; upon return, you may safely release it.
The starting point of the axis, in the shading's target coordinate space.
The ending point of the axis, in the shading's target coordinate space.
A CGFunction object created by the function CGFunctionCreate
.
This object refers to your function for creating an axial shading.
Quartz retains this object; upon return, you may safely release
it.
A Boolean value that specifies whether to extend the shading beyond the starting point of the axis.
A Boolean value that specifies whether to extend the shading beyond the ending point of the axis.
A new Quartz axial
shading. You are responsible for releasing this object using CGShadingRelease
.
An axial shading is a color blend that varies along a linear
axis between two endpoints and extends indefinitely perpendicular
to that axis. When you are ready to draw the shading, call the function CGContextDrawShading
.
CGShading.h
Creates a shading object to use for radial shading.
CGShadingRef CGShadingCreateRadial ( CGColorSpaceRef colorspace, CGPoint start, CGFloat startRadius, CGPoint end, CGFloat endRadius, CGFunctionRef function, bool extendStart, bool extendEnd );
The color space in which color values are expressed. Quartz retains this object; upon return, you may safely release it.
The center of the starting circle, in the shading's target coordinate space.
The radius of the starting circle, in the shading's target coordinate space.
The center of the ending circle, in the shading's target coordinate space.
The radius of the ending circle, in the shading's target coordinate space.
A CGFunction object created by the function CGFunctionCreate
.
This object refers to your function for creating a radial shading.
Quartz retains this object; upon return, you may safely release
it.
A Boolean value that specifies whether to extend the shading beyond the starting circle.
A Boolean value that specifies whether to extend the shading beyond the ending circle.
A new Quartz radial
shading. You are responsible for releasing this object using CGShadingRelease
.
A radial shading is a color blend that varies between two
circles. To draw the shading, call the function CGContextDrawShading
.
CGShading.h
Returns the Core Foundation type identifier for Quartz shading objects.
CFTypeID CGShadingGetTypeID ( void );
The Core Foundation
identifier for the opaque type CGShadingRef
.
CGShading.h
Decrements the retain count of a shading object.
void CGShadingRelease ( CGShadingRef shading );
The shading object to release.
This function is equivalent to CFRelease
,
except that it does not cause an error if the shading parameter
is NULL
.
CGShading.h
Increments the retain count of a shading object.
CGShadingRef CGShadingRetain ( CGShadingRef shading );
The shading object to retain.
The same shading object you
passed in as the shading
parameter.
This function is equivalent to CFRetain
,
except that it does not cause an error if the shading
parameter
is NULL
.
CGShading.h
An opaque type that represents a Quartz shading.
typedef struct CGShading *CGShadingRef;
CGShading.h
Last updated: 2006-12-22