void on_button_take_photo_clicked(object o, EventArgs args) { List<LongoMatch.Video.Utils.Device> devices = LongoMatch.Video.Utils.Device.ListVideoDevices(); if(devices.Count == 0) { new DialogMessage(Constants.MessageTypes.WARNING, Constants.CameraNotFound); return; } //deactivate camera to allow camera on edit person. videoOn will have same value to light checkbutton again later app1_checkbutton_video.Active = false; capturer = new CapturerBin(); CapturePropertiesStruct s = new CapturePropertiesStruct(); s.DeviceID = devices[0].ID; s.CaptureSourceType = CaptureSourceType.System; capturer.CaptureProperties = s; capturer.Type = CapturerType.Snapshot; capturer.Visible=true; capturer.NewSnapshot += on_snapshot_done; capturer.NewSnapshotMini += on_snapshot_mini_done; capturerWindow = new Gtk.Window("Capturer"); capturerWindow.Add(capturer); capturerWindow.Modal=true; capturerWindow.SetDefaultSize(400,400); person_win.Hide(); capturerWindow.ShowAll(); capturerWindow.Present(); capturerWindow.DeleteEvent += delegate(object sender, DeleteEventArgs e) {capturer.Close(); capturer.Dispose(); person_win.Show(); }; capturer.Run(); }
void on_button_take_photo_clicked(object o, EventArgs args) { capturer = new CapturerBin(); CapturePropertiesStruct s = new CapturePropertiesStruct(); s.CaptureSourceType = CaptureSourceType.Raw; capturer.CaptureProperties = s; capturer.Type = CapturerType.Snapshot; capturer.Visible=true; capturer.NewSnapshot += on_snapshot_done; capturer.NewSnapshotMini += on_snapshot_mini_done; capturerWindow = new Gtk.Window("Capturer"); capturerWindow.Add(capturer); capturerWindow.Modal=true; person_win.Hide(); capturerWindow.ShowAll(); capturerWindow.Present(); capturerWindow.DeleteEvent += delegate(object sender, DeleteEventArgs e) {capturer.Close(); capturer.Dispose(); person_win.Show(); }; capturer.Run(); }