Xojo Conferences
XDCMay2019MiamiUSA

Platforms to show: All Mac Windows Linux Cross-Platform

CGGradientMBS class

Type Topic Plugin Version macOS Windows Linux Console & Web iOS
class CoreGraphics MBS MacCG Plugin 11.2 Yes No No Yes, macOS only No
Function: A gradient defines a smooth transition between colors across an area.
Notes:
The CGGradientMBS class, and the functions that operate on it, make creating and using radial and axial gradient fills an easy task. A CGGradient object has a color space, two or more colors, and a location for each color. The color space cannot be a pattern or indexed color space, otherwise it can be any Quartz color space (CGColorSpaceMBS).

Colors can be provided as component values (such as red, green, blue) or as Quartz color objects (CGColorMBS). In Quartz, component can vary from 0.0 to 1.0, designating the proportion of the component present in the color.

A location is a normalized value. When it comes time to paint the gradient, Quartz maps the normalized location values to the points in coordinate space that you provide.

If you want more precise control over gradients, or if your application runs in versions of Mac OS X that are earlier than v10.5, see CGShadingMBS.

Requires Mac OS X 10.5.

Feedback, Comments & Corrections

Gradient Drawing Options

Constant Value Description
kCGGradientDrawsAfterEndLocation 2 The fill should extend beyond the ending location. The color that extends beyond the ending point is the solid color defined by the CGGradient object to be at location 1.
Available in Mac OS X v10.5 and later.
kCGGradientDrawsBeforeStartLocation 1 The fill should extend beyond the starting location. The color that extends beyond the starting point is the solid color defined by the CGGradient object to be at location 0.
Available in Mac OS X v10.5 and later.

This class has no sub classes.

Some methods using this class:

Some examples which use this class:

Blog Entries


The items on this page are in the following plugins: MBS MacCG Plugin.


CGFunctionMBS   -   CGImageDestinationMBS




Links
MBS FileMaker blog