Center (RadialGradientBrush)


Gets or sets the center of the outermost circle of the radial gradient.

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

Type: Point

The two-dimensional point that is located at the center of the radial gradient.

This property is read/write. The default value is a point with value 0.5,0.5.

The default central point location of the gradient circle is (0.5, 0.5).

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

The MappingMode property of a RadialGradientBrush determines whether the object's coordinate properties are interpreted as relative or absolute values. By default, Center is treated as relative, which corresponds to a MappingMode of RelativeToBoundingBox. A MappingMode of Absolute specifies that the Center value is expressed in coordinate pixels, not as a factor within the bounding box of the area where the brush is applied.

The following XAML example shows some RadialGradientBrush attribute usages.


  <!-- This rectangle is painted with a radial gradient. -->
  <Rectangle Width="200" Height="100">
      <RadialGradientBrush GradientOrigin="0.5,0.5" Center="0.5,0.5"
        RadiusX="0.5" RadiusY="0.5">
        <GradientStop Color="Yellow" Offset="0" />
        <GradientStop Color="Red" Offset="0.25" />
        <GradientStop Color="Blue" Offset="0.75" />
        <GradientStop Color="LimeGreen" Offset="1" />

Community Additions