public Viewport(ViewportController controller) { this.controller = controller; this.BackColor = Color.FromArgb(255, 44, 44, 44); this.DoubleBuffered = true; this.MouseWheel += Viewport_MouseWheel; resizers.Add(new EmbeddedButton(resizerBitmap, 0, 0, Cursors.SizeNWSE)); resizers.Add(new EmbeddedButton(resizerBitmap, 0, 0, Cursors.SizeNESW)); resizers.Add(new EmbeddedButton(resizerBitmap, 0, 0, Cursors.SizeNWSE)); resizers.Add(new EmbeddedButton(resizerBitmap, 0, 0, Cursors.SizeNESW)); toaster = new MessageToaster(this); }
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; }