/// <summary> /// Raises the <see cref="E:System.Windows.Forms.Form.Shown" /> event. /// </summary> /// <param name="e">A <see cref="T:System.EventArgs" /> that contains the event data.</param> protected async override void OnShown(EventArgs e) { base.OnShown(e); Set = new Set(); FilesGrid.DataSource = Set; try { await LiveView.Initialize(); CameraLabel.BackColor = Color.Green; } catch (Exception ex) { CameraLabel.BackColor = Color.Red; } try { _projector = new Projector(); await _projector.Initialize(); ProjectorLabel.BackColor = Color.Green; } catch { ProjectorLabel.BackColor = Color.Red; } }
/// <summary> /// Handles the 1 event of the ManualButton_Click control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param> private void ManualButton_Click(object sender, EventArgs e) { try { LiveView.Capture(); } catch (Exception ex) { MessageBox.Show(ex.Message, "Capture Exception", MessageBoxButtons.OK, MessageBoxIcon.Error); CameraLabel.BackColor = Color.Red; } }
/// <summary> /// Sets the transform of the live preview to fill the screen and be aligned /// in the landscape direction. /// </summary> public void SetupPreviewMatrix() { float width = mainLayout.Width; float height = mainLayout.Height; Matrix matrix = new Matrix(); matrix.PostRotate(0, width / 2.0f, height / 2.0f); LiveView.SetTransform(matrix); }
public static void OnConnect(LiveView liveView) { liveView.SetMenuItems(new LiveViewLib.MenuItem[] { new LiveViewLib.MenuItem(true, 30, "Menu0", GetPreview()), new LiveViewLib.MenuItem(true, 52, "Menu1", GetPreview()) }); liveView.deviceStatusListener += OnDeviceStatus; liveView.navigationListener += OnNavigation; liveView.alertListener += OnAlert; }
private void LiveViewButton_Click(object sender, EventArgs e) { if (LiveView.Running) { LiveView.Stop(); LiveViewButton.Text = "Live View"; } else { LiveView.Start(); LiveViewButton.Text = "Stop"; } }
private async void FocusButton_Checked(object sender, RoutedEventArgs e) { LiveView.Stretch = Stretch.None; if (FocusButton.IsChecked == true) { LiveView.Start(); LiveViewButton.IsChecked = false; } else { LiveView.Stop(); } }
/// <summary> /// Handles the Click event of the LiveViewButton control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="RoutedEventArgs"/> instance containing the event data.</param> private async void LiveViewButton_Click(object sender, RoutedEventArgs e) { LiveView.Stretch = Stretch.Uniform; if (LiveViewButton.IsChecked == true) { LiveView.Start(); FocusButton.IsChecked = false; } else { LiveView.Stop(); } }
/// <summary> /// Handles the Click event of the LiveViewButton control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param> private void LiveViewButton_Click(object sender, EventArgs e) { try { if (LiveViewButton.Checked) { LiveView.Start(); } else { LiveView.Stop(); } } catch (Exception ex) { MessageBox.Show(ex.Message, "Capture Exception", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
/// <summary> /// Sets the transform of the live preview to fill the screen and be aligned /// in the landscape direction. /// </summary> public void SetupPreviewMatrix() { float landscapeScreenRotation = 0.0f; if (windowManager.DefaultDisplay.Rotation == SurfaceOrientation.Rotation270) { landscapeScreenRotation = 180.0f; } float width = mainLayout.Width; float height = mainLayout.Height; Matrix matrix = new Matrix(); matrix.PostRotate(360.0f - landscapeScreenRotation - sensorOrientation, width / 2.0f, height / 2.0f); if (sensorOrientation != 180) { matrix.PostScale(width / height, height / width, width / 2.0f, height / 2.0f); } LiveView.SetTransform(matrix); }
/// <summary> /// Raises the <see cref="E:System.Windows.FrameworkElement.Initialized" /> event. This method is invoked whenever <see cref="P:System.Windows.FrameworkElement.IsInitialized" /> is set to true internally. /// </summary> /// <param name="e">The <see cref="T:System.Windows.RoutedEventArgs" /> that contains the event data.</param> protected async override void OnInitialized(EventArgs e) { base.OnInitialized(e); try { Globals.Initialize(); await Globals.Projector.Initialize(); } catch (RelayBoardException) { LampToggleButton.IsEnabled = false; FanToggleButton.IsEnabled = false; LoadButton.IsEnabled = false; } try { await LiveView.Initialize(); } catch (Exception) { } }
public void Next() { LiveView.CurrentScreen = LiveView.LiveScouting; LiveView.ChangeTransitioningContent(); }
public static void OnDeviceStatus(LiveView liveView, DeviceStatusMessage message) { }
public void Previous() { LiveView.CurrentScreen = LiveView.ChoiceOfEnds; LiveView.ChangeTransitioningContent(); }
public void Next() { LiveView.CurrentScreen = LiveView.ChoiceOfServiceReceive; LiveView.ChangeTransitioningContent(); }
private void UserControl_Unloaded(object sender, RoutedEventArgs e) { LiveView.RemoveFromVisualTree(); }
private void CaptureButton_Click(object sender, EventArgs e) { LiveView.Capture(); }
public Test() { InitializeComponent(); try { RelayBoard.Initialize(); } catch (Exception ex) { SlideProjectorGroupBox.Enabled = false; } CameraGroupBox.Enabled = true; try { Camera.Initialize(); LiveView.Initialize(Camera.GetDevice()); // Configure ISO slider _isos = Camera.GetIsos(); IsoBar.SetRange(0, _isos.Length - 1); IsoBar.Scroll += (sender, e) => IsoLabel.Text = _isos[IsoBar.Value]; string iso = Camera.GetIso(); if (iso != null) { IsoBar.Value = _isos.ToList().IndexOf(iso); IsoLabel.Text = iso; } // Configure Aperture slider _apertures = Camera.GetApertures(); ApertureBar.SetRange(0, _apertures.Length - 1); ApertureBar.Scroll += (sender, e) => ApertureLabel.Text = _apertures[ApertureBar.Value]; string aperture = Camera.GetAperture(); if (aperture != null) { ApertureBar.Value = _apertures.ToList().IndexOf(aperture); ApertureLabel.Text = aperture; } // Configure shutter speed _shutters = Camera.GetShutterSpeeds(); ShutterSpeedBar.SetRange(0, _shutters.Length - 1); ShutterSpeedBar.Scroll += (sender, e) => ShutterSpeedLabel.Text = _shutters[ShutterSpeedBar.Value]; string shutter = Camera.GetShutterSpeed(); if (shutter != null) { ShutterSpeedBar.Value = _shutters.ToList().IndexOf(shutter); ShutterSpeedLabel.Text = shutter; } // Configure exposure _exposures = Camera.GetExposureCompensations(); ExposureCompensationBar.SetRange(0, _exposures.Length - 1); ExposureCompensationBar.Scroll += (sender, e) => ExposureCompensationLabel.Text = _exposures[ExposureCompensationBar.Value]; string exposure = Camera.GetExposureCompensation(); if (exposure != null) { ExposureCompensationBar.Value = _exposures.ToList().IndexOf(exposure); ShutterSpeedLabel.Text = exposure; } } catch (Exception ex) { CameraGroupBox.Enabled = false; } }
private void SingleCaptureButton_Click(object sender, RoutedEventArgs e) { LiveView.Capture(); }
public static void OnNavigation(LiveView liveView, NavigationMessage message) { liveView.Send(new NavigationResponse(LiveViewMessage.RESULT_EXIT)); }
public static void OnAlert(LiveView liveView, GetAlertMessage message) { liveView.Send(new GetAlertResponse(20, 10, 1, "tst", "ht", "bt", File.ReadAllBytes("test36.png"))); }
public AppLive() { MainPage = new LiveView(); }