示例#1
0
        private void Form1_Paint(object sender, PaintEventArgs e)
        {
            if (immortal == null)
            {
                return;
            }

            List <Point> myPoints;
            List <Point> otherPoints;

            immortal.GetAppStateExternal(out myPoints, out otherPoints);
            for (int i = 0; i < myPoints.Count() - 1; i++)
            {
                e.Graphics.DrawLine(Pens.Black, myPoints[i].X, myPoints[i].Y, myPoints[i + 1].X, myPoints[i + 1].Y);
            }
            for (int i = 0; i < otherPoints.Count() - 1; i++)
            {
                e.Graphics.DrawLine(Pens.Red, otherPoints[i].X, otherPoints[i].Y, otherPoints[i + 1].X, otherPoints[i + 1].Y);
            }
        }
示例#2
0
        private void Timer_Tick(object sender, object e)
        {
            if (immortal == null)
            {
                return;
            }

            if (immortal.DoneRecovering())
            {
                immortal.HandleUserInputExternal((int)pointerPosInternal.X, (int)pointerPosInternal.Y, pointerDownInternal);
            }

            canvas.Children.Clear();

            List <System.Drawing.Point> myPoints;
            List <System.Drawing.Point> otherPoints;

            immortal.GetAppStateExternal(out myPoints, out otherPoints);

            for (int i = 0; i < myPoints.Count() - 1; i++)
            {
                Line line = new Line();
                line.X1     = myPoints[i].X;
                line.Y1     = myPoints[i].Y;
                line.X2     = myPoints[i + 1].X;
                line.Y2     = myPoints[i + 1].Y;
                line.Stroke = new SolidColorBrush(Windows.UI.Colors.Black);
                canvas.Children.Add(line);
            }

            for (int i = 0; i < otherPoints.Count() - 1; i++)
            {
                Line line = new Line();
                line.X1     = otherPoints[i].X;
                line.Y1     = otherPoints[i].Y;
                line.X2     = otherPoints[i + 1].X;
                line.Y2     = otherPoints[i + 1].Y;
                line.Stroke = new SolidColorBrush(Windows.UI.Colors.Red);
                canvas.Children.Add(line);
            }
        }