Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Center (RadialGradientBrush)
Key
M11
M12
M21
M22
Tag
Uri
X1
X2
Y1
Y2
Collapse the table of content
Expand the table of content

Center (RadialGradientBrush)

Silverlight

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.

<Canvas
  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">

  <!-- This rectangle is painted with a radial gradient. -->
  <Rectangle Width="200" Height="100">
    <Rectangle.Fill>
      <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" />
      </RadialGradientBrush>
    </Rectangle.Fill>
  </Rectangle> 
  
</Canvas>

Community Additions

ADD
Show:
© 2015 Microsoft