예제 #1
0
        /// <summary>
        /// This function recognises tag, and gets relative x and y axis. It also gets orientation of the tag.
        /// </summary>
        /// <param name="sender">object sender</param>
        /// <param name="e">TagVisualizerEvent Arguments</param>
        private void OnVisualizationAdded(object sender, TagVisualizerEventArgs e)
        {
            textBox.Clear();
            LynxTagVisualization tag = (LynxTagVisualization)e.TagVisualization;

            //     Console.WriteLine(tag.VisualizedTag.Value);
            orientation          = tag.Orientation;
            xAxisTag             = tag.Center.X;
            yAxisTag             = tag.Center.Y;
            xAxisSend            = xAxisTag - (flashDist + 10);
            yAxisSend            = yAxisTag + ((40 * 2.22));
            x1AxisRecieveUpdated = xAxisTag + (flashDist - 40);
            y1AxisRecieveUpdated = yAxisTag + ((26 * 2.22));

            Canvas.SetLeft(sPanel, xAxisSend);
            Canvas.SetTop(sPanel, yAxisSend);
            LynxRect.Height = 465;
            LynxRect.Width  = 240;

            LynxRect.Fill = Brushes.Black;
            Canvas.SetZIndex(LynxRect, -1);
            Canvas.SetLeft(LynxRect, xAxisTag - 120);
            Canvas.SetTop(LynxRect, yAxisTag - 70);
            canvas.Children.Add(LynxRect);
            //    Console.WriteLine(orientation);

            for (int i = 1; i < 9; i++)
            {
                drawboxes(x1AxisRecieveUpdated, y1AxisRecieveUpdated + (i * (18 * 2.22)), orientation);
            }
        }
예제 #2
0
        private void OnVisualizationMoved(object sender, TagVisualizerEventArgs e)
        {
            LynxTagVisualization tag = (LynxTagVisualization)e.TagVisualization;

            orientation          = tag.Orientation;
            xAxisTag             = tag.Center.X;
            yAxisTag             = tag.Center.Y;
            xAxisSend            = xAxisTag - (flashDist + 10);
            yAxisSend            = yAxisTag + ((40 * 2.22));
            x1AxisRecieveUpdated = xAxisTag + (flashDist - 40);
            y1AxisRecieveUpdated = yAxisTag + ((26 * 2.22));

            LynxRect.Fill = Brushes.Black;
            Canvas.SetLeft(LynxRect, xAxisTag - 120);
            Canvas.SetTop(LynxRect, yAxisTag - 70);

            int intTotalChildren = myGrid.Children.Count - 1;

            for (int intCounter = intTotalChildren; intCounter >= 0; intCounter--)
            {
                if (myGrid.Children[intCounter].GetType() == typeof(Line))
                {
                    Line ucCurrentChild = (Line)myGrid.Children[intCounter];
                    myGrid.Children.Remove(ucCurrentChild);
                }
            }
            Canvas.SetLeft(sPanel, xAxisSend);
            Canvas.SetTop(sPanel, yAxisSend);
            temp.Clear();
            temp1.Clear();
            for (int i = 1; i < 9; i++)
            {
                drawboxes(x1AxisRecieveUpdated, y1AxisRecieveUpdated + (i * (18 * 2.22)), orientation);
            }
        }
예제 #3
0
        /// <summary>
        /// This function recognises tag, and gets relative x and y axis. It also gets orientation of the tag.
        /// </summary>
        /// <param name="sender">object sender</param>
        /// <param name="e">TagVisualizerEvent Arguments</param>
        private void OnVisualizationAdded(object sender, TagVisualizerEventArgs e)
        {
            welcomeFlag = true;
            if (welcomeFlag)
            {
                canvas.Background = new ImageBrush()
                {
                    ImageSource = new BitmapImage((new Uri(@"C:\background.jpg", UriKind.Absolute)))
                };
                myGrid.Children.Remove(loadingImg);
            }
            textBox.Clear();

            LynxTagVisualization tag = (LynxTagVisualization)e.TagVisualization;

            orientation          = tag.Orientation;
            xAxisTag             = tag.Center.X;
            yAxisTag             = tag.Center.Y;
            xAxisSend            = xAxisTag - (flashDist + 10);
            yAxisSend            = yAxisTag + ((40 * 2.22));
            x1AxisRecieveUpdated = xAxisTag + (flashDist - 40);
            y1AxisRecieveUpdated = yAxisTag + ((26 * 2.22));

            Canvas.SetLeft(sPanel, xAxisSend);
            Canvas.SetTop(sPanel, yAxisSend);
            LynxRect.Height = 465;
            LynxRect.Width  = 240;

            LynxRect.Fill = Brushes.Black;
            Canvas.SetZIndex(LynxRect, -1);
            Canvas.SetLeft(LynxRect, xAxisTag - 120);
            Canvas.SetTop(LynxRect, yAxisTag - 70);
            canvas.Children.Add(LynxRect);

            for (int i = 1; i < 9; i++)
            {
                drawboxes(x1AxisRecieveUpdated, y1AxisRecieveUpdated + (i * (18 * 2.22)), orientation);
            }

            Init();
        }