示例#1
0
        private DelayCompositeConfiguration GetConfiguration()
        {
            DelayCompositeConfiguration config = new DelayCompositeConfiguration();
            DelayCompositeType          t      = (DelayCompositeType)cbType.SelectedIndex;

            config.CompositeType = t;

            switch (t)
            {
            case DelayCompositeType.MultiReview:
                DelayCompositeMultiReviewControl dcmrc = configurationPanels[DelayCompositeType.MultiReview] as DelayCompositeMultiReviewControl;
                return(dcmrc.Configuration);

            case DelayCompositeType.SlowMotion:
                DelayCompositeSlowMotionControl dcsmc = configurationPanels[DelayCompositeType.SlowMotion] as DelayCompositeSlowMotionControl;
                return(dcsmc.Configuration);

            case DelayCompositeType.FrozenMosaic:
                DelayCompositeFrozenMosaicControl dcfmc = configurationPanels[DelayCompositeType.FrozenMosaic] as DelayCompositeFrozenMosaicControl;
                return(dcfmc.Configuration);

            default:
                break;
            }

            return(config);
        }
        private void InitializeUI(DelayCompositeConfiguration current)
        {
            this.Text            = ScreenManagerLang.FormConfigureComposite_Title;
            gbConfiguration.Text = ScreenManagerLang.Generic_Configuration;
            rbDelay.Text         = ScreenManagerLang.FormConfigureComposite_Delay;
            rbSlowMotion.Text    = ScreenManagerLang.FormConfigureComposite_SlowMotion;
            rbQuadrants.Text     = ScreenManagerLang.FormConfigureComposite_Quadrants;

            int currentType = (int)current.CompositeType;

            switch (current.CompositeType)
            {
            case DelayCompositeType.SlowMotion:
                rbSlowMotion.Checked = true;
                break;

            case DelayCompositeType.MultiReview:
                rbQuadrants.Checked = true;
                break;

            default:
            case DelayCompositeType.Basic:
                rbDelay.Checked = true;
                break;
            }
        }
示例#3
0
        public FormConfigureComposite(DelayCompositeConfiguration current)
        {
            this.currentConfiguration = current;

            InitializeComponent();
            InitializeUI();
        }
        public DelayCompositeFrozenMosaicControl(DelayCompositeConfiguration current)
        {
            InitializeComponent();

            lblImageCount.Text  = ScreenManagerLang.FormConfigureComposite_ImageCount;
            lblInterval.Text    = ScreenManagerLang.FormConfigureComposite_Interval;
            lblRefreshRate.Text = ScreenManagerLang.FormConfigureComposite_RefreshRate;
            lblStart.Text       = ScreenManagerLang.FormConfigureComposite_Start;

            Configuration = new DelayCompositeConfiguration();
            Configuration.CompositeType = DelayCompositeType.FrozenMosaic;

            if (current.CompositeType == DelayCompositeType.FrozenMosaic)
            {
                Configuration.ImageCount  = current.ImageCount;
                Configuration.RefreshRate = current.RefreshRate;
                Configuration.Start       = current.Start;
                Configuration.Interval    = current.Interval;
            }
            else
            {
                Configuration.ImageCount  = 16;
                Configuration.RefreshRate = 0.5f;
                Configuration.Start       = 0;
                Configuration.Interval    = 3;
            }

            InitializeUI();
        }
示例#5
0
        public DelayCompositeMultiReviewControl(DelayCompositeConfiguration current)
        {
            InitializeComponent();
            lblImageCount.Text = ScreenManagerLang.FormConfigureComposite_ImageCount;

            Configuration = new DelayCompositeConfiguration();
            Configuration.CompositeType = DelayCompositeType.MultiReview;

            if (current.CompositeType == DelayCompositeType.MultiReview)
            {
                Configuration.ImageCount = current.ImageCount;
            }
            else
            {
                Configuration.ImageCount = 4;
            }

            InitializeUI();
        }
        private DelayCompositeConfiguration GetConfiguration()
        {
            DelayCompositeConfiguration config = new DelayCompositeConfiguration();

            if (rbSlowMotion.Checked)
            {
                config.CompositeType = DelayCompositeType.SlowMotion;
            }
            else if (rbQuadrants.Checked)
            {
                config.CompositeType = DelayCompositeType.MultiReview;
            }
            else
            {
                config.CompositeType = DelayCompositeType.Basic;
            }

            return(config);
        }
示例#7
0
        private IDelayComposite GetComposite(DelayCompositeConfiguration configuration)
        {
            switch (configuration.CompositeType)
            {
            case DelayCompositeType.MultiReview:
                return(new DelayCompositeMultiReview(configuration));

            case DelayCompositeType.SlowMotion:
                return(new DelayCompositeSlowMotion(configuration));

            case DelayCompositeType.FrozenMosaic:
                return(new DelayCompositeFrozenMosaic(configuration));

            case DelayCompositeType.Mixed:
                return(new DelayCompositeMixed());

            default:
                return(new DelayCompositeBasic());
            }
        }
示例#8
0
        private void ConfigureComposite()
        {
            if (!cameraLoaded || cameraManager == null)
            {
                return;
            }

            FormConfigureComposite form = new FormConfigureComposite(delayCompositeConfiguration);

            FormsHelper.Locate(form);

            if (form.ShowDialog() == DialogResult.OK)
            {
                delayCompositeConfiguration = form.Configuration;
                delayComposite = GetComposite(delayCompositeConfiguration);
                delayCompositer.ResetComposite(delayComposite);
                PreferencesManager.CapturePreferences.DelayCompositeConfiguration = delayCompositeConfiguration;
                PreferencesManager.Save();
            }

            form.Dispose();
        }
示例#9
0
        public CaptureScreen()
        {
            // There are several nested lifetimes with symetric setup/teardown methods:
            // Screen -> ctor / BeforeClose.
            // Camera association -> LoadCamera / UnloadCamera.
            // Connection (frame grab) -> Connect / Disconnect.
            // Recording -> StartRecord / StopRecord.

            log.Debug("Constructing a CaptureScreen.");
            view = new CaptureScreenView(this);
            view.DualCommandReceived += OnDualCommandReceived;

            viewportController = new ViewportController();
            viewportController.DisplayRectangleUpdated += ViewportController_DisplayRectangleUpdated;
            viewportController.Poked += viewportController_Poked;

            view.SetViewport(viewportController.View);
            view.SetCapturedFilesView(capturedFiles.View);

            InitializeCaptureFilenames();
            InitializeTools();
            InitializeMetadata();

            delayCompositer             = new DelayCompositer(delayer);
            delayCompositeConfiguration = PreferencesManager.CapturePreferences.DelayCompositeConfiguration;
            delayComposite = GetComposite(delayCompositeConfiguration);
            delayCompositer.SetComposite(delayComposite);

            view.SetToolbarView(drawingToolbarPresenter.View);

            IntPtr forceHandleCreation = dummy.Handle; // Needed to show that the main thread "owns" this Control.

            nonGrabbingInteractionTimer.Interval = 40;
            nonGrabbingInteractionTimer.Tick    += NonGrabbingInteractionTimer_Tick;

            grabTimer.Tick += grabTimer_Tick;

            pipelineManager.FrameSignaled += pipelineManager_FrameSignaled;
        }
示例#10
0
        public DelayCompositeSlowMotionControl(DelayCompositeConfiguration current)
        {
            InitializeComponent();

            lblImageCount.Text       = ScreenManagerLang.FormConfigureComposite_ImageCount;
            lblSlowMotionFactor.Text = ScreenManagerLang.FormConfigureComposite_SlowMotionFactor;

            Configuration = new DelayCompositeConfiguration();
            Configuration.CompositeType = DelayCompositeType.SlowMotion;

            if (current.CompositeType == DelayCompositeType.SlowMotion)
            {
                Configuration.ImageCount  = current.ImageCount;
                Configuration.RefreshRate = current.RefreshRate;
            }
            else
            {
                Configuration.ImageCount  = 4;
                Configuration.RefreshRate = 0.5f;
            }

            InitializeUI();
        }
示例#11
0
 public DelayCompositeSlowMotion(DelayCompositeConfiguration configuration)
 {
     imageCount  = configuration.ImageCount;
     refreshRate = configuration.RefreshRate;
 }
示例#12
0
 public DelayCompositeMultiReview(DelayCompositeConfiguration configuration)
 {
     this.imageCount = configuration.ImageCount;
 }
 public FormConfigureComposite(DelayCompositeConfiguration current)
 {
     InitializeComponent();
     InitializeUI(current);
 }
        private int period;   // amount of time between refreshes, in frames. (all images are refreshed at once).

        public DelayCompositeFrozenMosaic(DelayCompositeConfiguration configuration)
        {
            imageCount = configuration.ImageCount;
            start      = configuration.Start;
            interval   = configuration.Interval;
        }