本文整理汇总了VB.NET中System.Windows.Input.TouchFrameEventArgs.GetPrimaryTouchPoint方法的典型用法代码示例。如果您正苦于以下问题:VB.NET TouchFrameEventArgs.GetPrimaryTouchPoint方法的具体用法?VB.NET TouchFrameEventArgs.GetPrimaryTouchPoint怎么用?VB.NET TouchFrameEventArgs.GetPrimaryTouchPoint使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Input.TouchFrameEventArgs
的用法示例。
在下文中一共展示了TouchFrameEventArgs.GetPrimaryTouchPoint方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的VB.NET代码示例。
示例1: first
For Each _touchPoint In e.GetTouchPoints(Me.canvas1)
If _touchPoint.Action = TouchAction.Down Then
' Clear the canvas and capture the touch to it.
canvas1.Children.Clear()
_touchPoint.TouchDevice.Capture(canvas1)
ElseIf _touchPoint.Action = TouchAction.Move Then
' This is the first (primary) touch point. Just record its position.
If _touchPoint.TouchDevice.Id = e.GetPrimaryTouchPoint(Me.canvas1).TouchDevice.Id Then
pt1.X = _touchPoint.Position.X
pt1.Y = _touchPoint.Position.Y
' This is not the first touch point; draw a line from the first point to this one.
ElseIf _touchPoint.TouchDevice.Id <> e.GetPrimaryTouchPoint(Me.canvas1).TouchDevice.Id Then
pt2.X = _touchPoint.Position.X
pt2.Y = _touchPoint.Position.Y
Dim _line As New Line()
_line.Stroke = New RadialGradientBrush(Colors.White, Colors.Black)
_line.X1 = pt1.X
_line.X2 = pt2.X
_line.Y1 = pt1.Y
_line.Y2 = pt2.Y
_line.StrokeThickness = 2
Me.canvas1.Children.Add(_line)
End If
ElseIf _touchPoint.Action = TouchAction.Up Then
' If this touch is captured to the canvas, release it.
If (_touchPoint.TouchDevice.Captured Is canvas1) Then
canvas1.ReleaseTouchCapture(_touchPoint.TouchDevice)
End If
End If
Next