0

如何使用荧光笔在 windows phone 8 中绘制一个,这就是背景上下文可见的原因。我正在创建一个绘图应用程序但如果有人对此有任何想法,请给我一些提示,请提前致谢。

4

2 回答 2

1

void Touch_FrameReported(object sender, TouchFrameEventArgs e) { try { int pointsNumber = e.GetTouchPoints(drawCanvas).Count; TouchPointCollection pointCollection = e.GetTouchPoints(drawCanvas);

            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(System.Windows.Media.Color.FromArgb(50,84,255,159));

                   // line.Stroke = new SolidColorBrush(Colors.Red);
                   // line.StrokeThickness = 100.0;
                    line.StrokeThickness = 20;


                  //  line.Height = 10;

                    SolidColorBrush scb = new SolidColorBrush(System.Windows.Media.Color.FromArgb(255, 29, 177, 0));
                    //postconstruction technique



                    line.Fill = new SolidColorBrush(Colors.Red);


                    drawCanvas.Children.Add(line);

                    preXArray[i] = pointCollection[i].Position.X;
                    preYArray[i] = pointCollection[i].Position.Y;

                    lastObject = i;
                    // drawCanvas.Children.RemoveAt(1);

                }
            }
        }

        catch (Exception er)
        {
            MessageBox.Show(er.Message);
        }
    }
于 2013-02-11T09:10:09.260 回答
1

对于屏幕绘图,您应该考虑使用 InkPresenter,因为它适合处理这些用例 @ http://www.nickharris.net/2010/03/silverlight-for-mobile-on-windows-phone-7-inkpresenter-fun/

于 2013-02-12T01:30:05.837 回答