コード例 #1
0
ファイル: MainForm.cs プロジェクト: Evilpaul/CANoeCamera
 private void SettingsButton_Click(object sender, EventArgs e)
 {
     if (videoDevice != null)
     {
         videoDevice.DisplayPropertyPage(IntPtr.Zero);
     }
 }
コード例 #2
0
ファイル: Form1.cs プロジェクト: jenyaza01/CamView
 private void bSettings_Click(object sender, EventArgs e)
 {
     if (videoSource.IsRunning)
     {
         videoSource.DisplayPropertyPage(Handle);
     }
 }
コード例 #3
0
 public void DisplayPropertyPage()
 {
     if (_VideoCaptureDevice != null)
     {
         _VideoCaptureDevice.DisplayPropertyPage(IntPtr.Zero);
     }
 }
コード例 #4
0
 private void PropertiesButtonClick(object sender, EventArgs e)
 {
     if (_videoSource != null)
     {
         _videoSource.DisplayPropertyPage(Handle);
     }
 }
コード例 #5
0
        private void bttnCamProp_Click(object sender, EventArgs e)
        {
            VideoCaptureDevice localSource = new VideoCaptureDevice(selectedWebcam);

            //localSource.DisplayPropertyPage(this.Handle); // modal dialog
            localSource.DisplayPropertyPage(IntPtr.Zero); // non-modal
        }
コード例 #6
0
 private void lblAudioDeviceSettings_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
 {
     if (SelectedAudioDevice != null)
     {
         SelectedAudioDevice.DisplayPropertyPage(this.Handle);                 // IntPtr.Zero
     }
 }
コード例 #7
0
        private void bttnCamProp_Click(object sender, EventArgs e)
        {
            //hjfgjgf

            if (CameraRig.ConnectedCameras[CameraRig.ConfigCam].cam.isIPCamera)
            {
                try
                {
                    IPAddress parsedIPAddress;
                    Uri       parsedUri;
                    string    name = CameraRig.ConnectedCameras[CameraRig.ConfigCam].cam.name;

                    //check that the url resolves
                    if (Uri.TryCreate(name, UriKind.Absolute, out parsedUri) && IPAddress.TryParse(parsedUri.DnsSafeHost, out parsedIPAddress))
                    {
                        bubble.openInternetBrowserAt("http:\\" + parsedIPAddress.ToString());
                    }
                }
                catch (Exception)
                {
                    bubble.logAddLine("Unable to connect webcam index site.");
                }
            }
            else
            {
                VideoCaptureDevice localSource = new VideoCaptureDevice(selectedWebcam);
                localSource.DisplayPropertyPage(IntPtr.Zero); // non-modal
            }
        }
コード例 #8
0
 private void Source1_Properties_Button_Click(object sender, EventArgs e)
 {
     if (videoSource != null)
     {
         videoSource.DisplayPropertyPage(this.Handle);
     }
 }
コード例 #9
0
ファイル: VideoEngine.cs プロジェクト: redshiba/Toxy
        public bool DisplayPropertyWindow(IntPtr handle)
        {
            try { _captureDevice.DisplayPropertyPage(handle); }
            catch { return(false); }

            return(true);
        }
コード例 #10
0
    // Some good info to make this more robust
    // http://haryoktav.wordpress.com/2009/03/21/webcam-in-c-aforgenet/
    //
    private void button1_Click(object sender, EventArgs e)
    {
        CustomerWebcam           = new VideoCaptureDevice(VideoCaptureDevices[comboBox1.SelectedIndex].MonikerString);
        CustomerWebcam.NewFrame += new NewFrameEventHandler(CustomerWebcam_NewFrame);
        int indexMin  = -1;
        int MinPixels = 0;
        int indexMax  = -1;
        int MaxPixels = 0;

        for (int i = 0; i < CustomerWebcam.VideoCapabilities.Length; i++)
        {
            int pixels = CustomerWebcam.VideoCapabilities[i].FrameSize.Height * CustomerWebcam.VideoCapabilities[i].FrameSize.Width;
            if (indexMin == -1)
            {
                indexMin = i; MinPixels = pixels;
            }
            if (indexMax == -1)
            {
                indexMax = i; MaxPixels = pixels;
            }
            if (pixels < MinPixels)
            {
                indexMin = i; MinPixels = pixels;
            }
            if (pixels > MaxPixels)
            {
                indexMax = i; MaxPixels = pixels;
            }
        }
        CustomerWebcam_CapabilitiesIndexMin = indexMin;
        CustomerWebcam_CapabilitiesIndexMax = indexMax;
        CustomerWebcam.VideoResolution      = CustomerWebcam.VideoCapabilities[indexMin];
        CustomerWebcam.DisplayPropertyPage(IntPtr.Zero);
        CustomerWebcam.Start();
    }
コード例 #11
0
 private void invokeCameraControlToolStripMenuItem_Click(object sender, EventArgs e)
 {
     if (videoSource1 == null)
     {
         return;
     }
     videoSource1.DisplayPropertyPage(this.Parent.Handle);
 }
コード例 #12
0
        private void startButton_Click(object sender, RoutedEventArgs e)
        {
            VideoDevice           = new VideoCaptureDevice(VideoCaptureDevices[sourcesComboBox.SelectedIndex].MonikerString);
            VideoDevice.NewFrame += VideoDevice_NewFrame;
            VideoDevice.Start();

            VideoDevice.DisplayPropertyPage(IntPtr.Zero);
        }
コード例 #13
0
 private void buttonWebCamSettings_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         IntPtr hwnd = new WindowInteropHelper(this).Handle;
         captureDevice.DisplayPropertyPage(hwnd);
     }
     catch { }
 }
コード例 #14
0
ファイル: CamControl.cs プロジェクト: kooshar/project-371
        public static void show_Controls()
        {
            VideoCaptureDevice   Cam1;
            FilterInfoCollection VideoCaptureDevices;

            VideoCaptureDevices = new FilterInfoCollection(FilterCategory.VideoInputDevice);
            Cam1 = new VideoCaptureDevice(VideoCaptureDevices[0].MonikerString);
            Cam1.DisplayPropertyPage(IntPtr.Zero); //This will display a form with camera controls
        }
コード例 #15
0
 private void Property_button(object sender, EventArgs e)
 {
     if (pictureBox1.Image != null)                   // since image = object
     {
         FinalFrame.DisplayPropertyPage(IntPtr.Zero); //This will display a form with camera controls
     }
     else
     {
         MessageBox.Show("Properties are not available", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);;
     }
 }
コード例 #16
0
ファイル: FormConfiguration.cs プロジェクト: jfpk/kinoveaIDS
 private void btnDeviceProperties_Click(object sender, EventArgs e)
 {
     try
     {
         device.DisplayPropertyPage(this.Handle);
     }
     catch (Exception)
     {
         log.ErrorFormat(CameraLang.FormConfiguration_DevicePropertyPages_Error, summary.Alias);
     }
 }
コード例 #17
0
ファイル: Form1.cs プロジェクト: DogiDepytat/Git
 private void button4_Click(object sender, EventArgs e)
 {
     try
     {
         videoSource.DisplayPropertyPage(this.Handle);
     }
     catch
     {
         MessageBox.Show("Включите Web-Камеру");
     }
 }
コード例 #18
0
 /// <summary>
 /// The Cameraparameters.
 /// </summary>
 private void Cameraparameters()
 {
     if (!(videoSource == null))
     {
         if (videoSource.IsRunning)
         {
             videoSource.DisplayPropertyPage(IntPtr.Zero);
             //var x = videoSource.VideoCapabilities;
             //var y = videoSource.VideoResolution;
         }
     }
 }
コード例 #19
0
 private void butAdvice_Click(object sender, EventArgs e)
 {
     try
     {
         VideoCaptureDevice camAdvice = new VideoCaptureDevice(_filterInfoCollection[cbxDevName.SelectedIndex].MonikerString);
         camAdvice.DisplayPropertyPage(this.Handle);
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
コード例 #20
0
        public void AdvanceSetting()
        {
            if (null == this.SelectedCamera)
            {
                return;
            }

            this.SelectedCamera.SignalToStop();
            this.SelectedCamera.WaitForStop();
            this.SelectedCamera.Stop();
            SelectedCamera.DisplayPropertyPage(this.WindowHandle);
            SelectedCamera.Start();
        }
コード例 #21
0
		public void DisplayDevicePropertyPage(IntPtr _windowHandle)
		{
			VideoCaptureDevice device = m_VideoSource as VideoCaptureDevice;
			if(device != null)
			{
				try
				{
					device.DisplayPropertyPage(_windowHandle);
				}
				catch(Exception)
				{
					log.ErrorFormat("Error when trying to display device property page.");
				}	
			}
		}
コード例 #22
0
        /// <summary>
        /// 设置摄像头参数
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void CameraSetting_Click(object sender, RoutedEventArgs e)
        {
            FilterInfoCollection videoDevices = new FilterInfoCollection(FilterCategory.VideoInputDevice);
            var cameraIndex = XCameraList.SelectedIndex;

            if (videoDevices.Count > 0)
            {
                var    camera = new VideoCaptureDevice(videoDevices[cameraIndex].MonikerString);
                IntPtr hwnd   = new WindowInteropHelper(this).Handle;
                camera.DisplayPropertyPage(hwnd);
            }
            else
            {
                MessageBox.Show("读取摄像头出错,未找到有效的摄像头!", "系统提示", MessageBoxButton.OK, MessageBoxImage.Information);
            }
        }
コード例 #23
0
        private void Form1_Load(object sender, EventArgs e)
        {
            FilterInfoCollection fic = new FilterInfoCollection(FilterCategory.VideoInputDevice);

            videoDevice = new VideoCaptureDevice(fic[0].MonikerString);
            videoDevice.DisplayPropertyPage(IntPtr.Zero);
            videoDevice.NewFrame += VideoDevice_NewFrame;
            videoDevice.Start();

            baiduAi = FaceAi.GetInstance();
            voiceAi = VoiceAi.GetInstance();

            Thread mythread = new Thread(ThreadMain);

            mythread.Start();

            string voiceFilePath = voiceAi.Tts("百度AI");

            voiceAi.Play(voiceFilePath);
        }
コード例 #24
0
ファイル: VideoIn.cs プロジェクト: kostistlac/dx11-vvvv-1
 public void ShowProperties()
 {
     videoSource.DisplayPropertyPage(IntPtr.Zero);
 }
コード例 #25
0
 private void button_cam_config_Click(object sender, EventArgs e)
 {
     videoSource.DisplayPropertyPage(IntPtr.Zero);
 }
コード例 #26
0
ファイル: VideoCapture.cs プロジェクト: danartri/PanoBeam
 public void ShowCameraSettings(IntPtr parentWindow)
 {
     _videoDevice?.DisplayPropertyPage(parentWindow);
 }
コード例 #27
0
 private void WebCamOptionButton_Click(object sender, RoutedEventArgs e)
 {
     LocalWebCam.DisplayPropertyPage(IntPtr.Zero);
 }
コード例 #28
0
ファイル: Form1.cs プロジェクト: glenninn/testptz
 private void foo()
 {
     Cam1.DisplayPropertyPage(IntPtr.Zero); //This will display a form with camera controls
 }
コード例 #29
0
 public void CameraSettings()
 {
     camera.DisplayPropertyPage(IntPtr.Zero);
 }
コード例 #30
0
 private void Button_Click(object sender, RoutedEventArgs e)
 {
     CloseOptions();
     videoSource.DisplayPropertyPage(new WindowInteropHelper(this).Handle);
 }