Exemple #1
0
        private void NumberIRChanged(object sender, SelectionChangedEventArgs e)
        {
            labelSelectIR.Visibility = Visibility.Collapsed;
            labelDrag.Visibility     = Visibility.Visible;

            ClearDragCanvas();

            numberOfIR = (int)comboBoxNumberIR.SelectedValue;

            if (numberOfIR >= 1)
            {
                IlluminationEllipseUC ir = new IlluminationEllipseUC(irUCSize, irUCSize);
                dragCanvas.Children.Add(ir);
                Canvas.SetTop(ir, irBelowLeft.Y);
                Canvas.SetLeft(ir, irBelowLeft.X);
            }

            if (numberOfIR >= 2)
            {
                IlluminationEllipseUC ir = new IlluminationEllipseUC(irUCSize, irUCSize);
                dragCanvas.Children.Add(ir);
                Canvas.SetTop(ir, irBelowRight.Y);
                Canvas.SetLeft(ir, irBelowRight.X);
            }
        }
Exemple #2
0
        private void Init()
        {
            dragCanvas.IsCalibrationCanvas = false; // enable left mouse drag/drop

            cameraIconLeft = dragCanvas.Width / 2 - cameraIconWidth / 2;
            cameraIconTop  = dragCanvas.Height - cameraIconHeight * 1.5;

            irBelowLeft  = new Point(70, 205);
            irAboveLeft  = new Point(70, 15);
            irBelowRight = new Point(320, 205);
            irAboveRight = new Point(320, 15);

            comboBoxNumberIR.Items.Add(1);
            comboBoxNumberIR.Items.Add(2);
            comboBoxNumberIR.SelectionChanged += new SelectionChangedEventHandler(NumberIRChanged);

            AddCameraIcon(cameraIconTop, cameraIconLeft);

            IlluminationEllipseUC ir = new IlluminationEllipseUC(irUCSize, irUCSize);

            dragCanvas.Children.Add(ir);
            Canvas.SetTop(ir, irBelowLeft.Y);
            Canvas.SetLeft(ir, irBelowLeft.X);

            IlluminationEllipseUC ir2 = new IlluminationEllipseUC(irUCSize, irUCSize);

            dragCanvas.Children.Add(ir2);
            Canvas.SetTop(ir2, irBelowRight.Y);
            Canvas.SetLeft(ir2, irBelowRight.X);
        }
        private void Init()
        {
            dragCanvas.IsCalibrationCanvas = false; // enable left mouse drag/drop

            cameraIconLeft = dragCanvas.Width/2 - cameraIconWidth/2;
            cameraIconTop = dragCanvas.Height - cameraIconHeight*1.5;

            irBelowLeft = new Point(70, 205);
            irAboveLeft = new Point(70, 15);
            irBelowRight = new Point(320, 205);
            irAboveRight = new Point(320, 15);

            comboBoxNumberIR.Items.Add(1);
            comboBoxNumberIR.Items.Add(2);
            comboBoxNumberIR.SelectionChanged += new SelectionChangedEventHandler(NumberIRChanged);

            AddCameraIcon(cameraIconTop, cameraIconLeft);

            IlluminationEllipseUC ir = new IlluminationEllipseUC(irUCSize, irUCSize);
            dragCanvas.Children.Add(ir);
            Canvas.SetTop(ir, irBelowLeft.Y);
            Canvas.SetLeft(ir, irBelowLeft.X);

            IlluminationEllipseUC ir2 = new IlluminationEllipseUC(irUCSize, irUCSize);
            dragCanvas.Children.Add(ir2);
            Canvas.SetTop(ir2, irBelowRight.Y);
            Canvas.SetLeft(ir2, irBelowRight.X);
        }
        private void NumberIRChanged(object sender, SelectionChangedEventArgs e)
        {
            labelSelectIR.Visibility = Visibility.Collapsed;
            labelDrag.Visibility = Visibility.Visible;

            ClearDragCanvas();

            numberOfIR = (int) comboBoxNumberIR.SelectedValue;

            if(numberOfIR >= 1)
            {
                IlluminationEllipseUC ir = new IlluminationEllipseUC(irUCSize,irUCSize);
                dragCanvas.Children.Add(ir);
                Canvas.SetTop(ir, irBelowLeft.Y);
                Canvas.SetLeft(ir, irBelowLeft.X);
            }

            if(numberOfIR >= 2)
            {
                IlluminationEllipseUC ir = new IlluminationEllipseUC(irUCSize,irUCSize);
                dragCanvas.Children.Add(ir);
                Canvas.SetTop(ir, irBelowRight.Y);
                Canvas.SetLeft(ir, irBelowRight.X);
            }
        }