Udostępnij za pośrednictwem


StartPoint (LinearGradientBrush)

Microsoft Silverlight will reach end of support after October 2021. Learn more.

Gets or sets the two-dimensional coordinates for the start point of the linear gradient.

<object StartPoint="Point"  .../>
value = object.StartPoint
object.StartPoint = value

Property Value

Type: Point

The two-dimensional coordinates for the start point of the linear gradient.

This property is read/write. The default value is a Point with value 0,0.

Managed Equivalent

StartPoint

Remarks

See the "Remarks" section in the Point reference topic for scripting usages of this property.

A LinearGradientBrush paints an area with a linear gradient. A linear gradient defines a gradient along a line. The line's points are defined by the StartPoint and EndPoint properties of the linear gradient. A LinearGradientBrush brush paints its GradientStops along this line.

The default linear gradient is diagonal, and the default mode for the gradient coordinate system is RelativeToBoundingBox. With these defaults, the StartPoint of a linear gradient is 0,0, which is the upper-left corner of the area being painted. Its EndPoint is 1.1, which is the lower-right corner of the area being painted. The colors in the resulting gradient are interpolated and applied along vectors that parallel this diagonal axis.

The following illustration shows a diagonal gradient. A 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

Shows a gradient axis.

The following illustration shows the same linear gradient with highlighted gradient stops.

Gradient stops in a linear gradient

Gradient with gradient stops.

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

Applies To

LinearGradientBrush

See Also

Reference