Επεξεργασία

Κοινή χρήση μέσω


LinearGradientBrush.EndPoint Property

Definition

Gets or sets the ending two-dimensional coordinates of the linear gradient.

public:
 property System::Windows::Point EndPoint { System::Windows::Point get(); void set(System::Windows::Point value); };
public System.Windows.Point EndPoint { get; set; }
member this.EndPoint : System.Windows.Point with get, set
Public Property EndPoint As Point

Property Value

The ending two-dimensional coordinates of the linear gradient. The default is (1,1).

Remarks

A LinearGradientBrush paints a gradient along a line. The line's start and end points are defined by the StartPoint and EndPoint properties of the LinearGradientBrush.

The default linear gradient is diagonal. In the default, the StartPoint of a linear gradient is (0,0), the upper-left corner of the area being filled, and its EndPoint is (1,1), the lower-right corner of the area being filled. The colors in the resulting gradient are interpolated along the diagonal path.

The following image shows a diagonal gradient. The black line was added to highlight the interpolation path of the gradient from the start point to the end point.

Gradient axis for a diagonal linear gradient
A diagonal linear gradient

Specifying Relative or Absolute Values

Note that the MappingMode property of a LinearGradientBrush determines whether its EndPoint is interpreted as a relative or absolute value. A MappingMode of RelativeToBoundingBox specifies that the EndPoint value is relative to the size of the painted area. A MappingMode of Absolute specifies that the EndPoint value is expressed in device independent pixels. By default, the MappingMode is set to RelativeToBoundingBox, making the EndPoint a relative value.

Dependency Property Information

Identifier field EndPointProperty
Metadata properties set to true None

Applies to

See also