Language

GradientBrush.SpreadMethod Property

Definition

Gets or sets the type of spread method that specifies how to draw a gradient that starts or ends inside the bounds of the object to be painted.

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

Property Value

The type of spread method used to paint the gradient. The default is Pad.

Examples

The following example applies different SpreadMethod settings to several LinearGradientBrush and RadialGradientBrush objects.


  

    
    
      

        
        
          
          
        
      
    

    
      

        
        
          
          
        
      
    

    
      

        
        
          
          
        
      
    

    
    
      

        
        
          
          
        
      
    

    
      

        
        
          
          
        
      
    

    
      

        
        
          
          
        
      
    

  

Remarks

The following illustration shows the available spread methods and their effect on LinearGradientBrush and RadialGradientBrush. The red line indicates the gradient space. A LinearGradientBrush defines its gradient space with its StartPoint and EndPoint properties. A RadialGradientBrush defines its gradient space with its Center, RadiusX, and RadiusY properties.

Different GradientSpread settings Gradient spread methods

Dependency Property Information

Item Value
Identifier field SpreadMethodProperty
Metadata properties set to true None

Applies to

See also