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

适用于