Bagikan melalui


EllipseStylusShape Konstruktor

Definisi

Menginisialisasi instans baru kelas EllipseStylusShape.

Overload

EllipseStylusShape(Double, Double)

Menginisialisasi instans EllipseStylusShape baru kelas dengan lebar dan tinggi yang ditentukan.

EllipseStylusShape(Double, Double, Double)

Menginisialisasi instans EllipseStylusShape baru kelas dengan lebar, tinggi, dan sudut yang ditentukan.

Keterangan

Contoh berikut menunjukkan cara membuat EllipseStylusShape dan meneruskannya ke GetIncrementalStrokeHitTester metode untuk menghapus sebagian dari Stroke. Contoh ini mengasumsikan bahwa ada yang IncrementalStrokeHitTester dipanggil eraseTester dan bahwa peristiwanya StrokeHit telah terhubung ke penanganan aktivitas yang ditentukan dalam contoh ini. Untuk membuat kontrol yang memungkinkan pengguna menghapus tinta, lihat Cara: Menghapus Tinta pada Kontrol Kustom.

// 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)

Menginisialisasi instans EllipseStylusShape baru kelas dengan lebar dan tinggi yang ditentukan.

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)

Parameter

width
Double

Lebar bentuk stylus.

height
Double

Tinggi bentuk stylus.

Contoh

Contoh berikut menunjukkan cara membuat EllipseStylusShape dan meneruskannya ke GetIncrementalStrokeHitTester metode untuk menghapus sebagian dari Stroke. Contoh ini mengasumsikan bahwa ada yang IncrementalStrokeHitTester dipanggil eraseTester dan bahwa peristiwanya StrokeHit telah terhubung ke penanganan aktivitas yang ditentukan dalam contoh ini. Untuk membuat kontrol yang memungkinkan pengguna menghapus tinta, lihat Cara: Menghapus Tinta pada Kontrol Kustom.

// 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

Berlaku untuk

EllipseStylusShape(Double, Double, Double)

Menginisialisasi instans EllipseStylusShape baru kelas dengan lebar, tinggi, dan sudut yang ditentukan.

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)

Parameter

width
Double

Lebar bentuk stylus.

height
Double

Tinggi bentuk stylus.

rotation
Double

Sudut bentuk stylus.

Contoh

Contoh berikut menunjukkan cara membuat EllipseStylusShape dan meneruskannya ke GetIncrementalStrokeHitTester metode untuk menghapus sebagian dari Stroke. Contoh ini mengasumsikan bahwa ada yang IncrementalStrokeHitTester dipanggil eraseTester dan bahwa peristiwanya StrokeHit telah terhubung ke penanganan aktivitas yang ditentukan dalam contoh ini. Untuk membuat kontrol yang memungkinkan pengguna menghapus tinta, lihat Cara: Menghapus Tinta pada Kontrol Kustom.

// 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

Berlaku untuk