共用方式為


EllipseStylusShape 建構函式

定義

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

多載

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

適用於