Windows Silverlight 8.1应用程序中的墨迹
我试图在我的桌面上(它有一个触摸屏显示器)在Visual Studio 2013中运行Windows Phone仿真器(仿真器8.1 WVGA 4英寸512 MB) 现在我更改了MyIP_MouseLeftButtonDown和MyIP_MouseMove函数,以输出一些调试数据,如下所示:Windows Silverlight 8.1应用程序中的墨迹,silverlight,windows-phone,mouseevent,windows-phone-8-emulator,Silverlight,Windows Phone,Mouseevent,Windows Phone 8 Emulator,我试图在我的桌面上(它有一个触摸屏显示器)在Visual Studio 2013中运行Windows Phone仿真器(仿真器8.1 WVGA 4英寸512 MB) 现在我更改了MyIP_MouseLeftButtonDown和MyIP_MouseMove函数,以输出一些调试数据,如下所示: private void MyIP_MouseLeftButtonDown(object sender, MouseEventArgs e) { My
private void MyIP_MouseLeftButtonDown(object sender, MouseEventArgs e)
{
MyIP.CaptureMouse();
StylusPointCollection MyStylusPointCollection = new StylusPointCollection();
MyStylusPointCollection.Add(e.StylusDevice.GetStylusPoints(MyIP));// MyIP is required here because it is the object with reference to which we get our stylus point's coordinates
NewStroke = new Stroke(MyStylusPointCollection);
Debug.WriteLine("Mouse Down"+MyStylusPointCollection.Count);
MyIP.Strokes.Add(NewStroke);
}
private void MyIP_MouseMove(object sender, MouseEventArgs e)
{
StylusPointCollection MyStylusPointCollection = new StylusPointCollection();
MyStylusPointCollection.Add(e.StylusDevice.GetStylusPoints(MyIP));
Debug.WriteLine("Mouse Move" + MyStylusPointCollection.Count);
if (NewStroke != null)
NewStroke.StylusPoints.Add(MyStylusPointCollection);
}
现在运行应用程序时有两种情况:
鼠标移动1
鼠标按下1
鼠标移动1
鼠标移动1
鼠标移动1
鼠标移动1
鼠标移动1
鼠标移动1
鼠标移动1
鼠标移动1
鼠标移动1
鼠标移动1
鼠标移动1
鼠标移动1
鼠标移动1
鼠标移动1
鼠标移动1
鼠标移动1
鼠标移动1
鼠标移动1
鼠标按下1根据我使用墨迹的经验,有时移动事件似乎不够快。这意味着鼠标焦点会丢失,而不会报告一些累积的移动。例如: 鼠标按下1
鼠标移动1
…[鼠标移动]未报告,但点数已累积…
不使用上次报告的鼠标移动到丢失点的坐标处理[鼠标丢失] 是否可以尝试添加LostMouseCapture事件侦听器,在其中添加鼠标丢失的最后一个点/段