다음을 통해 공유


DrawingAttributes.Width 속성

업데이트: 2007년 11월

잉크를 그릴 때 펜 팁의 x축 크기(너비)를 가져오거나 설정합니다.

네임스페이스:  Microsoft.Ink
어셈블리:  Microsoft.Ink(Microsoft.Ink.dll)

구문

‘선언
Public Property Width As Single
‘사용 방법
Dim instance As DrawingAttributes
Dim value As Single

value = instance.Width

instance.Width = value
public float Width { get; set; }
public:
property float Width {
    float get ();
    void set (float value);
}
/** @property */
public float get_Width()
/** @property */
public  void set_Width(float value)
public function get Width () : float
public function set Width (value : float)

속성 값

형식: System.Single
잉크를 그릴 때 펜 팁의 x축 크기(너비)입니다.

의미

53

펜 팁의 너비가 53 HIMETRIC 단위입니다.

Single

펜 팁의 너비를 HIMETRIC 단위로 나타내는 값입니다.

설명

Width 속성은 HIMETRIC 단위입니다.

태블릿이 펜 압력을 보고하는 경우(IgnorePressure 속성이 false인 경우) 잉크의 실제 너비는 그리기 표면에 적용되는 압력에 따라 다릅니다. 최대 압력이 적용된 경우의 너비는 Width 속성 값의 150%입니다. 최소 압력이 적용된 경우의 너비는 Width 속성 값의 50%입니다. 기본적으로는 펜의 압력이 보고됩니다. 압력을 보고하지 않고 잉크 너비를 일정하게 유지하도록 지정하려면 IgnorePressure 속성을 true로 설정합니다.

정밀도는 HIMETRIC 단위 하나의 1,000분의 1(소수점 이하 3자리)로 제한됩니다. 예를 들어 값을 2.0006으로 지정하면 가장 정밀한 측정값인 2.001이 사용됩니다.

예제

이 C# 예제에서는 DrawingAttributes 개체의 Width 속성을 변경하는 메뉴 항목의 이벤트 처리기를 만듭니다.

using Microsoft.Ink;
//...
    private System.Windows.Forms.MenuItem menuInkWidthThin;
    private System.Windows.Forms.MenuItem menuInkWidthThick;
    private InkCollector theInkCollector;
    private System.Windows.Forms.MenuItem checkedWidth;

//...
    private void menuInkWidthThin_Click(
    object sender, System.EventArgs e)
    {
        checkedWidth.Checked = false;
        // Set the width about one pixel wide in HIMETRIC
        theInkCollector.DefaultDrawingAttributes.Width = 30;
        checkedWidth = menuInkWidthThin;
        checkedWidth.Checked = true;
        Refresh();
    }

    private void menuInkWidthThick_Click(
    object sender, System.EventArgs e)
    {
        checkedWidth.Checked = false;
        // Set the width about ten pixels wide in HIMETRIC
        theInkCollector.DefaultDrawingAttributes.Width = 300;
        checkedWidth = menuInkWidthThick;
        checkedWidth.Checked = true;
        Refresh();
    }

이 Microsoft® Visual Basic® .NET 예제에서는 DrawingAttributes 개체의 Width 속성을 변경하는 메뉴 항목의 이벤트 처리기를 만듭니다.

Imports Microsoft.Ink
'...
    Dim MenuInkWidthThin As System.Windows.Forms.MenuItem
    Dim MenuInkWidthThick As System.Windows.Forms.MenuItem
    Dim CheckedWidth As System.Windows.Forms.MenuItem
    Dim theInkCollector As InkCollector
'...
    Private Sub MenuInkWidthThin_Click( _
    ByVal sender As Object, ByVal e As System.EventArgs)
        CheckedWidth.Checked = False
        'Set the width about one pixel wide in HIMETRIC
        theInkCollector.DefaultDrawingAttributes.Width = 30
        CheckedWidth = MenuInkWidthThin
        CheckedWidth.Checked = True
        Refresh()
    End Sub

    Private Sub MenuInkWidthThick_Click( _
    ByVal sender As Object, ByVal e As System.EventArgs)
        CheckedWidth.Checked = False
        theInkCollector.DefaultDrawingAttributes.Width = 300
        CheckedWidth = MenuInkWidthThick
        CheckedWidth.Checked = True
        Refresh()
    End Sub

플랫폼

Windows Vista

.NET Framework 및 .NET Compact Framework에서 모든 플랫폼의 전체 버전을 지원하지는 않습니다. 지원되는 버전의 목록을 보려면 .NET Framework 시스템 요구 사항을 참조하십시오.

버전 정보

.NET Framework

3.0에서 지원

참고 항목

참조

DrawingAttributes 클래스

DrawingAttributes 멤버

Microsoft.Ink 네임스페이스

DrawingAttributes.PenTip

DrawingAttributes.Height

DrawingAttributes.IgnorePressure