Comparteix a través de


Pen.MiterLimit Propiedad

Definición

Obtiene o establece el límite de la proporción de la longitud del ángulo en la mitad de la propiedad Thickness de esta pluma.

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 propiedad

Double

Límite de la proporción de la longitud del ángulo en la mitad de la propiedad Thickness de la pluma. Este valor siempre es un número positivo mayor o igual que 1. El valor predeterminado es 10.0.

Ejemplos

En el ejemplo siguiente se muestra cómo usar la MiterLimit propiedad para limitar el tamaño de una esquina creada por dos segmentos de línea.

<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>

En la ilustración siguiente se muestra lo que genera este ejemplo de código.

Muestra el ejemplo miterLimit. La esquina formada se corta.

Comentarios

Un miter es una articulación hecha biseando cada una de las dos superficies que se van a unir para formar una esquina. Cuando dos segmentos de línea se encuentran en un ángulo agudo, el miter puede extenderse más allá del grosor de la línea que trazo el trazado.

Información sobre propiedades de dependencia

Campo identificador MiterLimitProperty
Propiedades de metadatos establecidas en true Ninguno

Se aplica a

Consulte también