GradientBrush.MappingMode Propriedade
Definição
Importante
Algumas informações dizem respeito a um produto pré-lançado que pode ser substancialmente modificado antes de ser lançado. A Microsoft não faz garantias, de forma expressa ou implícita, em relação à informação aqui apresentada.
Obtém ou define uma BrushMappingMode enumeração que especifica se as coordenadas de posicionamento do pincel de gradiente são absolutas ou relativas à área de saída.
public:
property System::Windows::Media::BrushMappingMode MappingMode { System::Windows::Media::BrushMappingMode get(); void set(System::Windows::Media::BrushMappingMode value); };
public System.Windows.Media.BrushMappingMode MappingMode { get; set; }
member this.MappingMode : System.Windows.Media.BrushMappingMode with get, set
Public Property MappingMode As BrushMappingMode
Valor de Propriedade
Um BrushMappingMode valor que especifica como as coordenadas de posicionamento do pincel gradiente são interpretadas. A predefinição é RelativeToBoundingBox.
Exemplos
O exemplo seguinte mostra como usar a MappingMode propriedade para especificar que sistema de coordenadas usar para o StartPoint e EndPoint do gradiente.
<Page
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<StackPanel>
<!-- Both of the rectangles below have identical gradients applied but use different
coordinate systems to specify the StartPoint and EndPoint of the gradient. -->
<Rectangle Width="200" Height="100" Margin="10">
<Rectangle.Fill>
<!-- The MappingMode property is set to "Absolute" which specifies that the coordinate
system used for the StartPoint and EndPoint properties is not relative to the
Brush output area. Values are interpreted directly in local space (in pixels). -->
<LinearGradientBrush MappingMode="Absolute"
StartPoint="0,50" EndPoint="200,50">
<GradientStop Color="Yellow" Offset="0" />
<GradientStop Color="Red" Offset="0.25" />
<GradientStop Color="Blue" Offset="0.75" />
<GradientStop Color="LimeGreen" Offset="1" />
</LinearGradientBrush>
</Rectangle.Fill>
</Rectangle>
<Rectangle Width="200" Height="100" Margin="10">
<Rectangle.Fill>
<!-- The MappingMode property is set to "RelativeToBoundingBox" (default) which
specifies the coordinate system for the StartPoint and EndPoint are relative to
the Brush output area: 0 indicates 0 percent of the output area and 1 indicates
100 percent of the output area. -->
<LinearGradientBrush StartPoint="0,0.5" EndPoint="1,0.5">
<GradientStop Color="Yellow" Offset="0" />
<GradientStop Color="Red" Offset="0.25" />
<GradientStop Color="Blue" Offset="0.75" />
<GradientStop Color="LimeGreen" Offset="1" />
</LinearGradientBrush>
</Rectangle.Fill>
</Rectangle>
</StackPanel>
</Page>
Observações
Um valor de Absolute indica que as coordenadas do pincel de gradiente são expressas usando píxeis independentes do dispositivo.
Informação de Propriedade de Dependência
| Iteme | Value |
|---|---|
| Campo identificador | MappingModeProperty |
Propriedades dos metadados definidas como true |
None |