【发布时间】:2013-12-16 17:27:08
【问题描述】:
我收到错误,因为“System.Windows.ni.dll 中发生了 'System.ArgumentException' 类型的异常,但未在用户代码中处理”
void Touch_FrameReported(object sender, TouchFrameEventArgs e)
{
int pointsNumber = e.GetTouchPoints(img1).Count; \\ I got the Exception in this Line
TouchPointCollection pointCollection = e.GetTouchPoints(img1);
for (int i = 0; i < pointsNumber; i++)
{
if (pointCollection[i].Action == TouchAction.Down)
{
preXArray[i] = pointCollection[i].Position.X;
preYArray[i] = pointCollection[i].Position.Y;
}
if (pointCollection[i].Action == TouchAction.Move)
{
line = new Line();
line.X1 = preXArray[i];
line.Y1 = preYArray[i];
line.X2 = pointCollection[i].Position.X;
line.Y2 = pointCollection[i].Position.Y;
line.Stroke = new SolidColorBrush(Colors.White);
line.StrokeStartLineCap = PenLineCap.Round;
line.StrokeEndLineCap = PenLineCap.Round;
line.StrokeThickness = 20;
img1.Children.Add(line);
preXArray[i] = pointCollection[i].Position.X;
preYArray[i] = pointCollection[i].Position.Y;
}
}
}
如何在 Windows Phone 8 中处理此异常
【问题讨论】:
标签: windows-phone-8