Pen.MiterLimit プロパティ

定義

このペンの Thickness の半分に対する、接合部の長さの割合に関する制限を取得または設定します。

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

プロパティ値

Double

ペンの Thickness の半分に対する接合部の長さの割合に関する制限。 この値は、常に 1 以上の正の数値です。 既定値は 10.0 です。

次の例は、プロパティを MiterLimit 使用して、2 つの線分で作成されるコーナーのサイズを制限する方法を示しています。

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

次の図は、このコード例で生成される内容を示しています。

MiterLimit の例を示します。形成された角が切られる。

注釈

マイターは、角を形成するために結合される 2 つのサーフェスのそれぞれを面取りすることによって作成されたジョイントです。 2 つの直線セグメントが鋭角で会うと、マイターはパスをストロークする線の太さを超えて伸びることがあります。

依存プロパティ情報

識別子フィールド MiterLimitProperty
に設定されたメタデータ プロパティ true なし

適用対象

こちらもご覧ください