Exemplo n.º 1
0
        private void bROI_ItemClick(object sender, RoutedEventArgs e)
        {
            //position the ROI rectangle over the camera image
            Canvas.SetTop(roi, still.Height * .40);
            Canvas.SetLeft(roi, still.Width * .20);

            roi.Width      = myCanvas.ActualWidth * .60;
            roi.Visibility = Visibility.Visible;
            //add adoner to the ROI rectangle so the user can grow/shrink area
            aLayer = AdornerLayer.GetAdornerLayer(roi);
            aLayer.Add(new ResizingAdorner(roi));

            scaleX = RoiSizes[(int)rectSides.width] / (float)still.Width;
            scaleY = RoiSizes[(int)rectSides.height] / (float)still.Height;
            cam.StopCamera();
        }
Exemplo n.º 2
0
        private void FrameRateValue_PreviewMouseUp(object sender, MouseButtonEventArgs e)
        {
            bool bStopped = false;

            if (!cam.FeatureSupportsFlag((int)Feature.FrameRate, FEATURE_FLAG_SETTABLE_WHILE_STREAMING))
            {
                cam.StopCamera();
                bStopped = true;
            }
            float[] parms = new float[1];
            parms[0] = (float)Math.Round(Double.Parse(FrameRateSet.Text));
            cam.SetFeature(Feature.FrameRate, parms);
            if (bStopped)
            {
                cam.StartCamera();
            }
        }