EllipseStylusShape 建構函式

定義

初始化 EllipseStylusShape 類別的新執行個體。

多載

名稱 Description
EllipseStylusShape(Double, Double)

初始化一個以指定寬度與高度的新類別實例 EllipseStylusShape

EllipseStylusShape(Double, Double, Double)

初始化一個新的類別實例 EllipseStylusShape ,包含指定的寬度、高度與角度。

備註

以下範例示範如何建立 並EllipseStylusShape傳遞給 GetIncrementalStrokeHitTester 方法以擦除 。Stroke 此範例假設存在被 IncrementalStrokeHitTester 呼叫 eraseTester 的事件,且其 StrokeHit 事件已與本例定義的事件處理程序相連。 若要建立能讓使用者擦除墨水的控制項,請參見 「如何:在自訂控制項上擦除墨水」。

// Prepare to collect stylus packets. Get the 
// IncrementalHitTester from the InkPresenter's 
// StrokeCollection and subscribe to its StrokeHitChanged event.
protected override void OnStylusDown(StylusDownEventArgs e)
{
    base.OnStylusDown(e);

    EllipseStylusShape eraserTip = new EllipseStylusShape(3, 3, 0);
    eraseTester = 
        presenter.Strokes.GetIncrementalStrokeHitTester(eraserTip);
    eraseTester.StrokeHit += new StrokeHitEventHandler(eraseTester_StrokeHit);
    eraseTester.AddPoints(e.GetStylusPoints(this));
}
' Prepare to collect stylus packets. Get the 
' IncrementalHitTester from the InkPresenter's 
' StrokeCollection and subscribe to its StrokeHitChanged event.
Protected Overrides Sub OnStylusDown(ByVal e As StylusDownEventArgs)

    MyBase.OnStylusDown(e)

    Dim eraserTip As New EllipseStylusShape(3, 3, 0)
    eraseTester = presenter.Strokes.GetIncrementalStrokeHitTester(eraserTip)
    AddHandler eraseTester.StrokeHit, _
        AddressOf eraseTester_StrokeHit
    eraseTester.AddPoints(e.GetStylusPoints(Me))

End Sub

EllipseStylusShape(Double, Double)

初始化一個以指定寬度與高度的新類別實例 EllipseStylusShape

public:
 EllipseStylusShape(double width, double height);
public EllipseStylusShape(double width, double height);
new System.Windows.Ink.EllipseStylusShape : double * double -> System.Windows.Ink.EllipseStylusShape
Public Sub New (width As Double, height As Double)

參數

width
Double

觸控筆的寬度。

height
Double

觸控筆形狀的高度。

範例

以下範例示範如何建立 並EllipseStylusShape傳遞給 GetIncrementalStrokeHitTester 方法以擦除 。Stroke 此範例假設存在被 IncrementalStrokeHitTester 呼叫 eraseTester 的事件,且其 StrokeHit 事件已與本例定義的事件處理程序相連。 若要建立能讓使用者擦除墨水的控制項,請參見 「如何:在自訂控制項上擦除墨水」。

// Prepare to collect stylus packets. Get the 
// IncrementalHitTester from the InkPresenter's 
// StrokeCollection and subscribe to its StrokeHitChanged event.
protected override void OnStylusDown(StylusDownEventArgs e)
{
    base.OnStylusDown(e);

    EllipseStylusShape eraserTip = new EllipseStylusShape(3, 3, 0);
    eraseTester = 
        presenter.Strokes.GetIncrementalStrokeHitTester(eraserTip);
    eraseTester.StrokeHit += new StrokeHitEventHandler(eraseTester_StrokeHit);
    eraseTester.AddPoints(e.GetStylusPoints(this));
}
' Prepare to collect stylus packets. Get the 
' IncrementalHitTester from the InkPresenter's 
' StrokeCollection and subscribe to its StrokeHitChanged event.
Protected Overrides Sub OnStylusDown(ByVal e As StylusDownEventArgs)

    MyBase.OnStylusDown(e)

    Dim eraserTip As New EllipseStylusShape(3, 3, 0)
    eraseTester = presenter.Strokes.GetIncrementalStrokeHitTester(eraserTip)
    AddHandler eraseTester.StrokeHit, _
        AddressOf eraseTester_StrokeHit
    eraseTester.AddPoints(e.GetStylusPoints(Me))

End Sub

適用於

EllipseStylusShape(Double, Double, Double)

初始化一個新的類別實例 EllipseStylusShape ,包含指定的寬度、高度與角度。

public:
 EllipseStylusShape(double width, double height, double rotation);
public EllipseStylusShape(double width, double height, double rotation);
new System.Windows.Ink.EllipseStylusShape : double * double * double -> System.Windows.Ink.EllipseStylusShape
Public Sub New (width As Double, height As Double, rotation As Double)

參數

width
Double

觸控筆的寬度。

height
Double

觸控筆形狀的高度。

rotation
Double

觸控筆的角度。

範例

以下範例示範如何建立 並EllipseStylusShape傳遞給 GetIncrementalStrokeHitTester 方法以擦除 。Stroke 此範例假設存在被 IncrementalStrokeHitTester 呼叫 eraseTester 的事件,且其 StrokeHit 事件已與本例定義的事件處理程序相連。 若要建立能讓使用者擦除墨水的控制項,請參見 「如何:在自訂控制項上擦除墨水」。

// Prepare to collect stylus packets. Get the 
// IncrementalHitTester from the InkPresenter's 
// StrokeCollection and subscribe to its StrokeHitChanged event.
protected override void OnStylusDown(StylusDownEventArgs e)
{
    base.OnStylusDown(e);

    EllipseStylusShape eraserTip = new EllipseStylusShape(3, 3, 0);
    eraseTester = 
        presenter.Strokes.GetIncrementalStrokeHitTester(eraserTip);
    eraseTester.StrokeHit += new StrokeHitEventHandler(eraseTester_StrokeHit);
    eraseTester.AddPoints(e.GetStylusPoints(this));
}
' Prepare to collect stylus packets. Get the 
' IncrementalHitTester from the InkPresenter's 
' StrokeCollection and subscribe to its StrokeHitChanged event.
Protected Overrides Sub OnStylusDown(ByVal e As StylusDownEventArgs)

    MyBase.OnStylusDown(e)

    Dim eraserTip As New EllipseStylusShape(3, 3, 0)
    eraseTester = presenter.Strokes.GetIncrementalStrokeHitTester(eraserTip)
    AddHandler eraseTester.StrokeHit, _
        AddressOf eraseTester_StrokeHit
    eraseTester.AddPoints(e.GetStylusPoints(Me))

End Sub

適用於