Idioma

Pen.MiterLimit Propriedade

Definição

Obtém ou define o limite da razão entre o comprimento da esquadria e metade do Thicknesscomprimento desta caneta.

public:
 property double MiterLimit { double get(); void set(double value); };
public double MiterLimit { get; set; }
member this.MiterLimit : double with get, set
Public Property MiterLimit As Double

Valor de Propriedade

O limite da razão entre o comprimento da esquadria e metade da Thicknesscaneta. Este valor é sempre um número positivo maior ou igual a 1. O valor padrão é 10.0.

Exemplos

O exemplo seguinte mostra como usar a MiterLimit propriedade para limitar o tamanho de um canto criado por dois segmentos de linha.

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

    <Canvas Margin="100"  Width="100" Height="100">
      <Canvas.Background>
        <DrawingBrush>
          <DrawingBrush.Drawing>
            <GeometryDrawing>
              <GeometryDrawing.Geometry>
                <PathGeometry>
                  <PathGeometry.Figures>
                    <PathFigureCollection>
                      <PathFigure StartPoint="100,50">
                        <PathFigure.Segments>
                          <PathSegmentCollection>
                            <LineSegment Point="200,70" />
                            <LineSegment Point="100,60" />
                          </PathSegmentCollection>
                        </PathFigure.Segments>
                      </PathFigure>
                    </PathFigureCollection>
                  </PathGeometry.Figures>
                </PathGeometry>
              </GeometryDrawing.Geometry>
              <GeometryDrawing.Pen>

                <!-- The MiterLimit is set to a value of 0 so the corner formed
                     by where the two line segments join is cut or blunted. A larger 
                     value would allow for the corner to extend out even beyond 
                     the thickness of the line. -->
                <Pen Brush="Blue" Thickness="4" MiterLimit="0"  />
              </GeometryDrawing.Pen>
            </GeometryDrawing>
          </DrawingBrush.Drawing>
        </DrawingBrush>
      </Canvas.Background>
    </Canvas>

  </StackPanel>

</Page>

A ilustração seguinte mostra o que este exemplo de código produz.

Mostra o exemplo do MiterLimit. O canto formado é cortado.

Observações

Uma esquadria é uma junta feita ao biselar cada uma de duas superfícies para serem unidas e formar um canto. Quando dois segmentos de linha se encontram num ângulo acentuado, a esquadria pode estender-se para além da espessura da linha que traça o caminho.

Informação de Propriedade de Dependência

Iteme Value
Campo identificador MiterLimitProperty
Propriedades dos metadados definidas como true None

Aplica-se a

Consulte também