다음을 통해 공유


DrawingAttributes.Width 속성

정의

를 그리 Stroke는 데 사용되는 스타일러스의 너비를 가져오거나 설정합니다.

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

속성 값

를 그리는 데 사용되는 스타일러스의 너비입니다 Stroke.

예외

속성이 WidthEpsilon 거나 NaN입니다.

예제

다음 예제에서는 속성을 설정 하는 방법을 보여 줍니다 Width . 이 예제에서는 애플리케이션에 호출된 InkCanvas 개체와 두 inkCanvas1개의 DrawingAttributes 개체가 호출 inkDA 된 것으로 가정합니다 highlighterDA. 전체 예제는 클래스 개요를 DrawingAttributes 참조하세요.

// Set up the DrawingAttributes for the pen.
inkDA = new DrawingAttributes();
inkDA.Color = Colors.SpringGreen;
inkDA.Height = 5;
inkDA.Width = 5;
inkDA.FitToCurve = false;
inkDA.StylusTipTransform = new Matrix(1, 0, 0, 5, 0, 0);

// Set up the DrawingAttributes for the highlighter.
highlighterDA = new DrawingAttributes();
highlighterDA.Color = Colors.Orchid;
highlighterDA.IsHighlighter = true;
highlighterDA.IgnorePressure = true;
highlighterDA.StylusTip = StylusTip.Rectangle;
highlighterDA.Height = 30;
highlighterDA.Width = 10;

inkCanvas1.DefaultDrawingAttributes = inkDA;
' Set up the DrawingAttributes for the pen.
inkDA = New Ink.DrawingAttributes()
With inkDA
    .Color = Colors.SpringGreen
    .Height = 5
    .Width = 5
    .FitToCurve = True
    .StylusTipTransform = New Matrix(1, 0, 0, 1, 20, 0)
End With

' Set up the DrawingAttributes for the highlighter.
highlighterDA = New Ink.DrawingAttributes()
With highlighterDA
    .Color = Colors.Orchid
    .IsHighlighter = True
    .IgnorePressure = True
    .StylusTip = StylusTip.Rectangle
    .Height = 30
    .Width = 10
End With

inkCanvas1.DefaultDrawingAttributes = inkDA

설명

다음 요소는 렌더링될 때의 Stroke 높이와 너비에 영향을 주지만 속성 값에는 Width 영향을 미치지 않습니다.

속성을 DIP(디바이스 독립적 픽셀)0으로 설정 Width 하면 2 DIP로 변경됩니다.

XAML 텍스트 사용

이 속성은 일반적으로 XAML에서 사용되지 않습니다.

적용 대상