GradientBrush.ColorInterpolationMode Özellik

Tanım

ColorInterpolationModeDegradedeki renklerin nasıl ilişkilendirileceğini belirten bir sabit listesi alır veya ayarlar.Gets or sets a ColorInterpolationMode enumeration that specifies how the gradient's colors are interpolated.

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

Özellik Değeri

ColorInterpolationMode

Degradedeki renklerin nasıl ilişkilendirileceğini belirtir.Specifies how the colors in a gradient are interpolated. Varsayılan değer: SRgbLinearInterpolation.The default is SRgbLinearInterpolation.

Örnekler

Aşağıdaki örnek farklı renk ilişkilendirme modlarına sahip olan iki benzer gradyanı gösterir ve bu da enterpolasyon 'in farklı renk alanlarında oluşmasına neden olur.The following example shows two similar gradients that have different modes of color interpolation, which causes the interpolation to happen in different color spaces.

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

    <Rectangle Width="200" Height="100" Margin="10">
      <Rectangle.Fill>

        <!-- This gradient uses a ColorInterpolationMode of "ScRgbLinearInterpolation"
             which indicates that the colors of the gradient are interpolated using the
             ScRGB color space. -->
        <LinearGradientBrush ColorInterpolationMode="ScRgbLinearInterpolation" 
        StartPoint="0,0.5" EndPoint="1,0.5">
          <LinearGradientBrush.GradientStops>
            <GradientStop Color="Blue" Offset="0.0" />
            <GradientStop Color="Red" Offset="0.25" />
            <GradientStop Color="Blue" Offset="0.75" />
            <GradientStop Color="LimeGreen" Offset="1" />
          </LinearGradientBrush.GradientStops>
        </LinearGradientBrush>
      </Rectangle.Fill>
    </Rectangle>

    <Rectangle Width="200" Height="100" Margin="10">
      <Rectangle.Fill>

        <!-- This gradient uses a ColorInterpolationMode of "SRgbLinearInterpolation"
             which indicates that the colors of the gradient are interpolated using the
             sRGB color space. -->
        <LinearGradientBrush ColorInterpolationMode="SRgbLinearInterpolation" 
        StartPoint="0,0.5" EndPoint="1,0.5">
          <LinearGradientBrush.GradientStops>
            <GradientStop Color="Blue" Offset="0.0" />
            <GradientStop Color="Red" Offset="0.25" />
            <GradientStop Color="Blue" Offset="0.75" />
            <GradientStop Color="LimeGreen" Offset="1" />
          </LinearGradientBrush.GradientStops>
        </LinearGradientBrush>
      </Rectangle.Fill>
    </Rectangle>

  </StackPanel>
</Page>

Aşağıdaki çizimde, önceki örneğin ne oluşturduğu gösterilmektedir.The following illustration shows what the preceding example produces.

Farklı ilişkilendirme modunu gösteren iki gradyanTwo gradients showing different interpolation mode

Açıklamalar

Bağımlılık Özelliği BilgileriDependency Property Information

Tanımlayıcı alanıIdentifier field ColorInterpolationModeProperty
Meta veri özellikleri olarak ayarlandı trueMetadata properties set to true YokNone

Şunlara uygulanır