我尝试用几种不同的方式对其进行修改,但无法使触摸工作在屏幕上进行绘制。
程序在此功能上失败
Public Function InkCanvas_PointerPressed(sender As Object, e As PointerRoutedEventArgs)
'Get information about the pointer location
Dim pt As PointerPoint = e.GetCurrentPoint(panelcanvas)
_previousContactPt = pt.Position
'Accept input only from a pen or mouse with a left button pressed
Dim pointerDevType As PointerDeviceType = e.Pointer.PointerDeviceType
If ((pointerDevType = PointerDeviceType.Pen Or pointerDevType = PointerDeviceType.Mouse) And pt.Properties.IsLeftButtonPressed) Then
'Pass the point information to the inkmanager
_inkManager.ProcessPointerDown(pt)
_penID = pt.PointerId
e.Handled = True
ElseIf (pointerDevType = PointerDeviceType.Touch) Then
_touchID = pt.PointerId
_inkManager.ProcessPointerDown(pt) '<-- error happens here
e.Handled = True
End If
Return Nothing
End Function
我收到以下错误消息 = TabletPC 墨迹错误代码。_inkManager.ProcessPointerDown(pt) 行上的初始化失败(HRESULT 异常:0x80040223)。