1
我正在使用以下示例。 http://msdn.microsoft.com/en-us/library/windows/apps/windows.ui.xaml.input.pointereventhandler?cs-save-lang=1&cs-lang=vb#code-snippet-1在WinRT中使用觸摸繪圖
我試過修改它幾種不同的方法,但我不能使觸摸工作在屏幕上繪製。
該程序失敗關於此函數
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)。