Freigeben über


IXRLinearGradientBrush (Compact 2013)

3/28/2014

This class represents a brush that paints an area with a linear gradient.

Syntax

class IXRLinearGradientBrush : public IXRGradientBrush

Inheritance Hierarchy

IXRDependencyObject

    IXRBrush

        IXRGradientBrush

            IXRLinearGradientBrush

Methods

Method

Description

IXRLinearGradientBrush::GetEndPoint

Retrieves the two-dimensional coordinates of the ending point for this linear gradient.

IXRLinearGradientBrush::GetStartPoint

Retrieves the two-dimensional coordinates of the starting point for this linear gradient.

IXRLinearGradientBrush::SetEndPoint

Sets the two-dimensional coordinates of the ending point for this linear gradient.

IXRLinearGradientBrush::SetStartPoint

Sets the two-dimensional coordinates of the starting point for this linear gradient.

Thread Safety

Members of this class are thread-safe if you previously called IXRApplication::CreateHostFromXaml and supplied it with an XRWindowCreateParams structure that has AllowsMultipleThreadAccess set to true.

Remarks

An IXRLinearGradientBrush object defines a gradient pattern along a line. The endpoints of the line are defined by the StartPoint and EndPoint properties of the linear gradient. A linear gradient paints its IXRGradientStop objects along the line. Each IXRGradientStop is stored in the collection retrieved by the inherited method IXRGradientBrush::GetGradientStops.

With the default setting, the StartPoint of a linear gradient is an XRPoint with a value of (0,0), the upper-left corner of the area being painted, and its EndPoint is an XRPoint with a value of (1,1), the lower-right corner of the area being painted. The colors in the resulting gradient are interpolated along the diagonal path.

You can specify a gradient axis that does not completely fill the area being painted. To do this, use the IXRGradientBrush::SetSpreadMethod inherited method.

When you create a class instance, use an IXRLinearGradientBrushPtr smart pointer instead of a raw interface pointer. For more information, see XRPtr<Interface>.

You can also define a linear gradient in Microsoft Silverlight 3 XAML. For information about the differences between XAML in XAML for Windows Embedded and Silverlight 3, see Differences Between Microsoft Silverlight 3 and XAML for Windows Embedded. For more information about how to define this element in the source XAML for your application, see the LinearGradientBrush Class on MSDN.

.NET Framework Equivalent

System.Windows.Media.LinearGradientBrush

Requirements

Header

XamlRuntime.h

sysgen

SYSGEN_XAML_RUNTIME

See Also

Reference

Classes for Visual Appearance