本文整理汇总了VB.NET中System.Windows.Ink.IncrementalHitTester.AddPoints方法的典型用法代码示例。如果您正苦于以下问题:VB.NET IncrementalHitTester.AddPoints方法的具体用法?VB.NET IncrementalHitTester.AddPoints怎么用?VB.NET IncrementalHitTester.AddPoints使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Ink.IncrementalHitTester
的用法示例。
在下文中一共展示了IncrementalHitTester.AddPoints方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的VB.NET代码示例。
示例1: OnStylusDown
' 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
' Collect the StylusPackets as the stylus moves.
Protected Overrides Sub OnStylusMove(ByVal e As StylusEventArgs)
If eraseTester.IsValid Then
eraseTester.AddPoints(e.GetStylusPoints(Me))
End If
End Sub
' Unsubscribe from the StrokeHitChanged event when the
' user lifts the stylus.
Protected Overrides Sub OnStylusUp(ByVal e As StylusEventArgs)
eraseTester.AddPoints(e.GetStylusPoints(Me))
RemoveHandler eraseTester.StrokeHit, _
AddressOf eraseTester_StrokeHit
eraseTester.EndHitTesting()
End Sub
' When the stylus intersects a stroke, erase that part of
' the stroke. When the stylus dissects a stoke, the
' Stroke.Erase method returns a StrokeCollection that contains
' the two new strokes.
Private Sub eraseTester_StrokeHit(ByVal sender As Object, _
ByVal args As StrokeHitEventArgs)
Dim eraseResult As StrokeCollection = _
args.GetPointEraseResults()
Dim strokesToReplace As New StrokeCollection()
strokesToReplace.Add(args.HitStroke)
' Replace the old stroke with the new one.
If eraseResult.Count > 0 Then
presenter.Strokes.Replace(strokesToReplace, eraseResult)
Else
presenter.Strokes.Remove(strokesToReplace)
End If
End Sub