Condividi tramite


IXpsOMGradientBrush interface

This interface describes a gradient that is made up of gradient stops. Classes that inherit from IXpsOMGradientBrush specify different ways of interpreting gradient stops.

IXpsOMGradientBrush is the base interface for the IXpsOMLinearGradientBrush and IXpsOMRadialGradientBrush interfaces.

When to implement

Never. Custom implementation of this interface is not supported.

Members

The IXpsOMGradientBrush interface inherits from IXpsOMBrush. IXpsOMGradientBrush also has these types of members:

  • Methods

Methods

The IXpsOMGradientBrush interface has these methods.

Method Description
GetColorInterpolationMode

Gets the gamma function to be used for color interpolation.

GetGradientStops

Gets a pointer to an IXpsOMGradientStopCollection interface that contains the collection of IXpsOMGradientStop interfaces that define the gradient.

GetSpreadMethod

Gets the XPS_SPREAD_METHOD value, which describes how the area outside of the gradient region will be rendered.

GetTransform

Gets a pointer to the IXpsOMMatrixTransform interface that contains the resolved matrix transform for the brush.

GetTransformLocal

Gets a pointer to the IXpsOMMatrixTransform interface that contains the local, unshared, resolved matrix transform for the brush.

GetTransformLookup

Gets the name of the lookup key of the shared matrix transform interface that is to be used for the brush.

SetColorInterpolationMode

Sets the XPS_COLOR_INTERPOLATION value, which describes the gamma function to be used for color interpolation.

SetSpreadMethod

Sets the XPS_SPREAD_METHOD value, which describes how the area outside of the gradient region is to be rendered.

SetTransformLocal

Sets the IXpsOMMatrixTransform interface pointer to a local, unshared matrix transform that is to be used for the brush.

SetTransformLookup

Sets the name of the lookup key of a shared matrix transform that is to be used for the brush.

 

Remarks

The methods of this interface define the basic parameters of a gradient. The gradient type, which can be linear or radial, determines how these parameters are applied.

As shown in the figure that follows, the start and end points of a linear gradient mark the end points of the gradient path. The gradient path is the straight line that connects the start and end points. The gradient region of a linear gradient consists of the area between the start and end points, including those points, and extends in both directions at a right angle to the gradient path. The spread area is the area outside the gradient region.

Gradient stops define the color at specific locations along the gradient path; the color is interpolated along the gradient path between the gradient stops, as shown in the following illustration.

A figure that shows the terms used in a linear gradient

As shown in the figure that follows, the gradient region of a radial gradient is the area enclosed by the ellipse that is described by the center point and the x and y radii that extend from the center point. The spread area is the area outside of that ellipse. The gradient path is a radial line that sweeps the entire gradient region from the gradient origin to the ellipse that bounds the gradient region. In the following illustration, the gradient path is not shown.

A figure that shows the terms used in a radial gradient

The spread method describes how the spread area is filled. Implementation of the spread method depends on the gradient type (linear or radial). The following illustration shows several examples of how the spread area can be filled. For information about different spread methods, see XPS_SPREAD_METHOD.

An illustration that shows examples of the spread method

The transform determines how the resulting gradient is transformed. The visible part of the gradient that is ultimately rendered in the image is determined by the path, stroke, or glyph that is using the gradient brush.

Requirements

Minimum supported client

Windows 7, Windows Vista with SP2 and Platform Update for Windows Vista [desktop apps | Windows Store apps]

Minimum supported server

Windows Server 2008 R2, Windows Server 2008 with SP2 and Platform Update for Windows Server 2008 [desktop apps | Windows Store apps]

Header

Xpsobjectmodel.h

IDL

XpsObjectModel.idl

See also

IXpsOMBrush

IXpsOMLinearGradientBrush

IXpsOMRadialGradientBrush

Interfaces

XML Paper Specification