GradientBrush.ColorInterpolationMode Özellik

Tanım

Gradyan renklerinin nasıl ilişkilendirilmiş olduğunu belirten bir ColorInterpolationMode numaralandırma alır veya ayarlar.

C#
public System.Windows.Media.ColorInterpolationMode ColorInterpolationMode { get; set; }

Özellik Değeri

ColorInterpolationMode

Gradyandaki renklerin nasıl ilişkilendirilmiş olduğunu belirtir. Varsayılan değer: SRgbLinearInterpolation.

Örnekler

Aşağıdaki örnekte, farklı renk ilişkilendirme modlarına sahip olan ve ilişkilendirmenin farklı renk alanlarında gerçekleşmesine neden olan iki benzer gradyan gösterilmektedir.

XAML
<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 ürettiği gösterilmektedir.

Farklı ilişkilendirme modunu gösteren iki gradyan

Açıklamalar

Bağımlılık Özelliği Bilgileri

Tanımlayıcı alanı ColorInterpolationModeProperty
Meta veri özellikleri olarak ayarlandı true Hiçbiri

Şunlara uygulanır

Ürün Sürümler
.NET Framework 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8
Windows Desktop 3.0, 3.1, 5, 6, 7