GradientBrush.SpreadMethod GradientBrush.SpreadMethod GradientBrush.SpreadMethod GradientBrush.SpreadMethod Property

정의

색칠하는 개체 경계 내부에서 시작하거나 끝나는 그라데이션을 그리는 방법을 지정하는 칠하기 방법 형식을 가져오거나 설정합니다.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

속성 값

그라데이션을 그리는 데 사용되는 칠하기 방법의 형식입니다.The type of spread method used to paint the gradient. 기본값은 Pad입니다.The default is Pad.

예제

다음 예제에서는 다른 적용 SpreadMethod 설정을 여러 LinearGradientBrushRadialGradientBrush 개체입니다.The following example applies different SpreadMethod settings to several LinearGradientBrush and RadialGradientBrush objects.

<Page 
  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
  Title="Gradient Spread Methods">
  <StackPanel>

    <!-- The following three examples show the different gradient spread methods
         applied to linear gradient brushes. -->
    <Rectangle Width="150" Height="75" Stroke="Black">
      <Rectangle.Fill>

        <!-- Pad -->
        <LinearGradientBrush StartPoint="0.3,0.5" EndPoint="0.7,0.5" SpreadMethod="Pad">
          <GradientStop Color="White" Offset="0" />
          <GradientStop Color="#333333" Offset="1" />
        </LinearGradientBrush>
      </Rectangle.Fill>
    </Rectangle>

    <Rectangle Width="150" Height="75" Stroke="Black">
      <Rectangle.Fill>

        <!-- Reflect -->
        <LinearGradientBrush StartPoint="0.3,0.5" EndPoint="0.7,0.5" SpreadMethod="Reflect">
          <GradientStop Color="White" Offset="0" />
          <GradientStop Color="#333333" Offset="1" />
        </LinearGradientBrush>
      </Rectangle.Fill>
    </Rectangle>

    <Rectangle Width="150" Height="75" Stroke="Black">
      <Rectangle.Fill>

        <!-- Repeat -->
        <LinearGradientBrush StartPoint="0.3,0.5" EndPoint="0.7,0.5" SpreadMethod="Repeat">
          <GradientStop Color="White" Offset="0" />
          <GradientStop Color="#333333" Offset="1" />
        </LinearGradientBrush>
      </Rectangle.Fill>
    </Rectangle>

    <!-- The following three examples show the different gradient spread methods
         applied to radial gradient brushes. -->
    <Rectangle Width="150" Height="75" Stroke="Black">
      <Rectangle.Fill>

        <!-- Pad -->
        <RadialGradientBrush Center="0.5,0.5" RadiusX="0.3" RadiusY="0.3" SpreadMethod="Pad">
          <GradientStop Color="White" Offset="0" />
          <GradientStop Color="#333333" Offset="1" />
        </RadialGradientBrush>
      </Rectangle.Fill>
    </Rectangle>

    <Rectangle Width="150" Height="75" Stroke="Black">
      <Rectangle.Fill>

        <!-- Reflect -->
        <RadialGradientBrush Center="0.5,0.5" RadiusX="0.3" RadiusY="0.3" SpreadMethod="Reflect">
          <GradientStop Color="White" Offset="0" />
          <GradientStop Color="#333333" Offset="1" />
        </RadialGradientBrush>
      </Rectangle.Fill>
    </Rectangle>

    <Rectangle Width="150" Height="75" Stroke="Black">
      <Rectangle.Fill>

        <!-- Repeat -->
        <RadialGradientBrush Center="0.5,0.5" RadiusX="0.3" RadiusY="0.3" SpreadMethod="Repeat">
          <GradientStop Color="White" Offset="0" />
          <GradientStop Color="#333333" Offset="1" />
        </RadialGradientBrush>
      </Rectangle.Fill>
    </Rectangle>

  </StackPanel>
</Page>

설명

다음 그림에서 사용 가능한 spread 방법과 그 효과 나와 LinearGradientBrushRadialGradientBrush입니다.The following illustration shows the available spread methods and their effect on LinearGradientBrush and RadialGradientBrush. 빨간색 선은 그라데이션 공간을 나타냅니다.The red line indicates the gradient space. A LinearGradientBrush 그라데이션 해당 공간을 사용 하 여 정의 해당 StartPointEndPoint 속성입니다.A LinearGradientBrush defines its gradient space with its StartPoint and EndPoint properties. A RadialGradientBrush 그라데이션 해당 공간을 사용 하 여 정의 해당 CenterRadiusX, 및 RadiusY 속성입니다.A RadialGradientBrush defines its gradient space with its Center, RadiusX, and RadiusY properties.

여러 GradientSpread 설정Different GradientSpread settings
그라데이션 확산 메서드Gradient spread methods

종속성 속성 정보Dependency Property Information

식별자 필드Identifier field SpreadMethodProperty
메타 데이터 속성 설정 trueMetadata properties set to true 없음None

적용 대상

추가 정보