• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# DirectShow.FilterInfoCollection类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中AForge.Video.DirectShow.FilterInfoCollection的典型用法代码示例。如果您正苦于以下问题:C# FilterInfoCollection类的具体用法?C# FilterInfoCollection怎么用?C# FilterInfoCollection使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



FilterInfoCollection类属于AForge.Video.DirectShow命名空间,在下文中一共展示了FilterInfoCollection类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: start

        public void start()
        {
            Detector = Detector == null ? new Detector() : Detector;

            Detector.Detection += DetectorOnDetection;
            Dick = new Dick(Detector);
            if (!Detector.Detectors.Any())
            {
                for (int i = 0; i < 4; i++)
                {
                    Detector.Detectors.Add(new ColorDetector());
                }
            }
            Detector.Detectors.ForEach(x=> x.Detector = Detector);

            var cd = Detector.Detectors[0];
            Dick.DickParts.Add(new DickPart(PartName.Tip, cd));
            cd = Detector.Detectors[1];
            Dick.DickParts.Add(new DickPart(PartName.Medium, cd));
            cd = Detector.Detectors[2];
            Dick.DickParts.Add(new DickPart(PartName.Deep, cd));
            cd = Detector.Detectors[3];
            Dick.DickParts.Add(new DickPart(PartName.RealyDeep, cd));

            cmbDickPart.DataSource = Dick.DickParts;
            cmbDickPart.DisplayMember = "strName";

            FilterInfoCollection videoDevices = new FilterInfoCollection(FilterCategory.VideoInputDevice);
            Detector.Video = new VideoCaptureDevice(videoDevices[0].MonikerString);
            Detector.Start();
        }
开发者ID:NoGRo,项目名称:SbBjT,代码行数:31,代码来源:AreaDetector.cs


示例2: minero_class

        public minero_class(int puerto = 2134, GLOBAL_MODE modo = GLOBAL_MODE.MINI_MINERO)
        {
            _modoOperacion = modo;
            bmp1 = new Bitmap(640, 480, System.Drawing.Imaging.PixelFormat.Format24bppRgb);
            bw = new BackgroundWorker();
            _puerto = puerto;
            ipEnd = new IPEndPoint(IPAddress.Any, _puerto);
            bw.DoWork += new DoWorkEventHandler(bw_DoWork);

            if (_modoOperacion == GLOBAL_MODE.MINI_MINERO)
            {
                modeloRobot.setDeviceIndex(3);
            }
            else
            {
                modeloRobot.setDeviceIndex(4);
            }
            try
            {
                // enumerate video devices
                videoDevices = new FilterInfoCollection(FilterCategory.VideoInputDevice);
                // create video source
                videoSource = new VideoCaptureDevice(videoDevices[0].MonikerString);
                // set NewFrame event handler
                videoSource.NewFrame += videoSource_NewFrame;
            }
            catch (Exception ex)
            {

            }
            //jo¿ystick
            joy.JoystickEvent += joy_JoystickEvent;
        }
开发者ID:kill4n,项目名称:Kuro_ACM,代码行数:33,代码来源:minero_class.cs


示例3: SelectDevice

        public SelectDevice()
        {
            InitializeComponent();
            this.cameraDeviceNum = 0;
            #region
            this.videoDevices = new FilterInfoCollection(FilterCategory.VideoInputDevice);
            
            if (this.videoDevices.Count != 0)
            {
                //リストクリア
                this.listDevices.Items.Clear();
                //デバイス追加
                foreach (FilterInfo device in videoDevices)
                {
                    this.listDevices.Items.Add(device.Name);
                    this.cameraDeviceNum++;
                }
                this.listDevices.Items.Add("kinect");
                this.listDevices.SelectedIndex = 0;
            }
            else
            {
                this.listDevices.Items.Clear();
                this.listDevices.Items.Add("Kinect");
                this.listDevices.SelectedIndex = 0;
            }
            #endregion
            this.Show();

        }
开发者ID:mahoo168,项目名称:mahoo,代码行数:30,代码来源:SelectDevice.cs


示例4: VideoCaptureDeviceForm

        // Constructor
        public VideoCaptureDeviceForm( )
        {
            InitializeComponent( );

            // show device list
            try
            {
                // enumerate video devices
                videoDevices = new FilterInfoCollection( FilterCategory.VideoInputDevice );

                if ( videoDevices.Count == 0 )
                    throw new ApplicationException( );

                // add all devices to combo
                foreach ( FilterInfo device in videoDevices )
                {
                    devicesCombo.Items.Add( device.Name );
                }
            }
            catch ( ApplicationException )
            {
                devicesCombo.Items.Add( "No local capture devices" );
                devicesCombo.Enabled = false;
                okButton.Enabled = false;
            }

            devicesCombo.SelectedIndex = 0;
        }
开发者ID:xyicheng,项目名称:Accord,代码行数:29,代码来源:VideoCaptureDeviceForm.cs


示例5: CargarDispositive

 public void CargarDispositive(FilterInfoCollection Dispositive)
 {
     for (int i = 0; i < Dispositive.Count; i++) {
         cboDispositive.Items.Add(Dispositive[i].Name.ToString());
         cboDispositive.Text = cboDispositive.Items[0].ToString();
     }
 }
开发者ID:zStyle,项目名称:GoRecorder,代码行数:7,代码来源:Form1.cs


示例6: GetCamListCombobox

        //GetCamList
        public static void GetCamListCombobox(ComboBox c)
            
        {
            WebCamList = c;

            try
            {
                VideoDevices = new FilterInfoCollection(FilterCategory.VideoInputDevice);
                WebCamList.Items.Clear();

                foreach (FilterInfo device in VideoDevices)
                {
                    WebCamList.Items.Add(device.Name);
                }

                if (Properties.Settings.Default.WebCamDevice == null)
                {
                    WebCamList.SelectedIndex = 0; //First cam found is default
                }
                else
                {
                    WebCamList.SelectedIndex = WebCamList.FindString(Properties.Settings.Default.WebCamDevice);
                }
            }
            catch (ApplicationException)
            {
                //DeviceExist = false;
                WebCamList.Items.Add("No capture device on your system");
            }
        }
开发者ID:Enursha,项目名称:WebCamPassport,代码行数:31,代码来源:WebCam.cs


示例7: GetFrame

        public void GetFrame()
        {
            // enumerate video devices
            var videoDevices = new FilterInfoCollection(FilterCategory.VideoInputDevice);

            //foreach (FilterInfo item in videoDevices)
            //{

            //videoSource = new VideoCaptureDevice(item.MonikerString);
            videoSource = new VideoCaptureDevice(videoDevices[1].MonikerString);
            //videoSource.DesiredFrameSize = new Size(160, 120);

            // create video source
            //VideoCaptureDevice videoSource = new VideoCaptureDevice(videoDevices[0].MonikerString);

            // set NewFrame event handler
            videoSource.NewFrame += new NewFrameEventHandler(video_NewFrame);
            // start the video source
            videoSource.Start();
            // ...
            System.Threading.Thread.Sleep(500);
            Trace.WriteLine("FramesReceived: " + videoSource.FramesReceived);
            // signal to stop
            videoSource.SignalToStop();
            // ...
            //}
        }
开发者ID:JollySwagman,项目名称:Super8,代码行数:27,代码来源:Form1.cs


示例8: Form1

        public Form1()
        {
            InitializeComponent();

            dm.setDeviceIndex(3);
            comboBox2.DataSource = Enum.GetValues(typeof(MODELO_TYPE));

            // enumerate video devices
            videoDevices = new FilterInfoCollection(
                     FilterCategory.VideoInputDevice);
            // create video source
            videoSource = new VideoCaptureDevice(
                    videoDevices[0].MonikerString);
            // set NewFrame event handler
            videoSource.NewFrame += new NewFrameEventHandler(video_NewFrame);

            /*ax12_Rot = new AX_12_Motor();
            ax12_Dir = new AX_12_Motor();

            ax12_Dir.setDeviceID(3);
            ax12_Rot.setDeviceID(3);
            ax12_Dir.setBaudSpeed(BAUD_RATE.BAUD_1Mbps);
            ax12_Rot.setBaudSpeed(BAUD_RATE.BAUD_1Mbps);*/
            //button3_Click(null, null);
        }
开发者ID:kill4n,项目名称:Kuro_ACM,代码行数:25,代码来源:Form1.cs


示例9: button1_Click

        private void button1_Click(object sender, EventArgs e)
        {
            capturedevice = new FilterInfoCollection(FilterCategory.VideoInputDevice);

                if (pictureBox2.Image != null)
                {
                    pictureBox1.Image = (Image)pictureBox2.Image.Clone();
                }
                else
                {
                    MessageBox.Show("check the camera");
                }

                ////////////////////

                IBarcodeReader reader = new BarcodeReader();
                // load a bitmap
                var barcodeBitmap = (Bitmap)pictureBox1.Image;
                // detect and decode the barcode inside the bitmap
                var result = reader.Decode(barcodeBitmap);
                // do something with the result
                if (result != null)
                {
                    txtDecoderType.Text = result.BarcodeFormat.ToString();
                    txtDecoderContent.Text = result.Text;
                Console.Beep();
                }
        }
开发者ID:eissa4444,项目名称:use-a-camera-as-a-barcode-scanner,代码行数:28,代码来源:Form1.cs


示例10: Form1_Load

        private void Form1_Load(object sender, EventArgs e)
        {
            try
            {
                ///---实例化对象  
                USE_Webcams = new FilterInfoCollection(FilterCategory.VideoInputDevice);
                ///---摄像头数量大于0  
                if (USE_Webcams.Count > 0)
                {
                    ///---禁用按钮  
                    btn_Start.Enabled = true;
                    ///---实例化对象  
                    cam = new VideoCaptureDevice(USE_Webcams[0].MonikerString);
                    ///---绑定事件  
                    cam.NewFrame += new NewFrameEventHandler(Cam_NewFrame);
                }
                else
                {
                    ///--没有摄像头  
                    btn_Start.Enabled = false;
                    ///---提示没有摄像头  
                    MessageBox.Show("没有摄像头外设");
                }

            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
开发者ID:lev2048,项目名称:C_Sharp,代码行数:30,代码来源:Form1.cs


示例11: Start

        public void Start()
        {
            FilterInfoCollection videoDevices;
            string camDescr;
            try
            {
                videoDevices = new FilterInfoCollection(FilterCategory.VideoInputDevice);
                if (videoDevices.Count == 0)
                {
                    throw new ApplicationException("no webcams");
                }
                else
                {
                    camName = videoDevices[Convert.ToInt32(devIndex)].MonikerString;
                    camDescr = videoDevices[Convert.ToInt32(devIndex)].Name;
                }
            }
            catch (ApplicationException)
            {
                throw new ApplicationException("failed web cams initialize");
            }

            videoSource = new VideoCaptureDevice(camName);
            videoSource.NewFrame += new NewFrameEventHandler(video_NewFrame);
            videoSource.DesiredFrameSize = new Size(Convert.ToInt32(devWidth), Convert.ToInt32(devHeigth));//new Size(320, 240);//new Size(480, 360);//new Size(640, 480);//
            videoSource.DesiredFrameRate = 29;
            videoSource.Start();

            if (timerUploadImage == null)
            {
                timerUploadImage = new System.Timers.Timer(700);
                timerUploadImage.Elapsed += new ElapsedEventHandler(timerUploadImage_Tick);
                timerUploadImage.Start();
            }
        }
开发者ID:solsetmary,项目名称:Makhzan,代码行数:35,代码来源:WebcamDBService.cs


示例12: Form1

        public Form1()
        {
            InitializeComponent();

            // show device list
            try
            {
                // enumerate video devices
                videoDevices = new FilterInfoCollection(FilterCategory.VideoInputDevice);

                if (videoDevices.Count == 0)
                    throw new ApplicationException();

                // add all devices to combo
                foreach (FilterInfo device in videoDevices)
                {
                    devicesCombo.Items.Add(device.Name);
                }
            }
            catch (ApplicationException)
            {
                devicesCombo.Items.Add("No local capture devices");
                devicesCombo.Enabled = false;
                takePictureBtn.Enabled = false;
            }

            devicesCombo.SelectedIndex = 0;

            VideoCaptureDevice videoCaptureSource = new VideoCaptureDevice(videoDevices[devicesCombo.SelectedIndex].MonikerString);
            videoSourcePlayer.VideoSource = videoCaptureSource;
            videoSourcePlayer.Start();
        }
开发者ID:Reddine,项目名称:Webcam-Capture-AForge.Net,代码行数:32,代码来源:Form1.cs


示例13: FilterInfoCollection

        /// <summary>
        /// 获取摄像头列表
        /// </summary>
        /// <returns></returns>
        public List<string>GetCameraList()
        {
            List<string> lstReturn = new List<string>();

            try
            {
                VideoDevices = new FilterInfoCollection(FilterCategory.VideoInputDevice);

                if (VideoDevices.Count == 0)
                {
                    throw new ApplicationException();
                }

                foreach (FilterInfo device in VideoDevices)
                {
                    lstReturn.Add(device.Name);
                }

            }
            catch (ApplicationException)
            {
                lstReturn.Add("未发现本地视频设备");
                VideoDevices = null;
            }
             return lstReturn;
        }
开发者ID:mapig,项目名称:Jewelry,代码行数:30,代码来源:摄像头.cs


示例14: execute

        public void execute()
        {
            LocationSourceManager.Instance.Shutdown();
            this.videoPlayer.SignalToStop();
            this.videoPlayer.WaitForStop();

            FilterInfoCollection videoDevices = new FilterInfoCollection(FilterCategory.VideoInputDevice);
            VideoCaptureDevice videoSource = new VideoCaptureDevice(videoDevices[this.videoSourceCombo.SelectedIndex].MonikerString);

            int i = this.videoFormatCombo.SelectedIndex;
            videoSource.DesiredFrameSize = videoSource.VideoCapabilities[i].FrameSize;

            Size videoPlayerSize = videoSource.VideoCapabilities[i].FrameSize;
            videoPlayer.Size = videoPlayerSize;
            Size videoPlayerParentSize = videoPlayer.Parent.Size;
            videoPlayer.Location = new Point((videoPlayerParentSize.Width / 2) - (videoPlayerSize.Width / 2), (videoPlayerParentSize.Height / 2) - (videoPlayerSize.Height / 2));

            new UpdateMapSizeAndPosition(this.videoPlayer, MapOverlayForm.Instance).execute();

            Size mainFormMinSize = videoPlayerSize;
            mainFormMinSize.Width += 230;
            mainFormMinSize.Height += 50;
            if (mainFormMinSize.Height < 475)
                mainFormMinSize.Height = 475;
            this.mainForm.MinimumSize = mainFormMinSize;

            this.videoPlayer.VideoSource = videoSource;
            this.videoPlayer.Start();
        }
开发者ID:kr1schan,项目名称:PresenceSimulator,代码行数:29,代码来源:ChangeVideoFormatCommand.cs


示例15: GetFirstCameraDevice

        public CameraDevice GetFirstCameraDevice()
        {
            CameraDevice cameraDevice = null;
            // enumerate video devices
            FilterInfoCollection videoDevices = new FilterInfoCollection(FilterCategory.VideoInputDevice);
            if ((videoDevices != null) && (videoDevices.Count > 0))
            {
                // create video source
                VideoCaptureDevice videoDevice = new VideoCaptureDevice(videoDevices[0].MonikerString);
                List<CameraDevice> devicesData = _config.GetConfiguredCameraDevicesData().Where(a => a.ID == videoDevice.Source).ToList();
                if ((devicesData != null) && (devicesData.Count > 0))
                {
                    cameraDevice = devicesData[0];
                }
                else
                {
                    cameraDevice = new LocalCameraDevice();
                    cameraDevice.ID = videoDevice.Source;
                    cameraDevice.Name = "Camera";
                    _config.AddCameraDevice(cameraDevice);
                    _config.Save();
                }
                (cameraDevice as LocalCameraDevice).Init(videoDevice);

            }

            return cameraDevice;
        }
开发者ID:ShlomyShivek,项目名称:HomeSecure,代码行数:28,代码来源:CameraDeviceFactory.cs


示例16: CamControl

        /// Initializes a new instance of the CamControl
        public CamControl()
        {
            Devices = new FilterInfoCollection(FilterCategory.VideoInputDevice);

            // by default select the first one
            SetCamera(0);
        }
开发者ID:GeorgianCostea,项目名称:Xanders-Work,代码行数:8,代码来源:CamControl.cs


示例17: GetAvailableDevices

        public IList<CameraDevice> GetAvailableDevices()
        {
            List<CameraDevice> cameraDevices = new List<CameraDevice>();
            try
            {
                FilterInfoCollection filterInfoCollection = new FilterInfoCollection(FilterCategory.VideoInputDevice);

                if (filterInfoCollection.Count == 0)
                    return cameraDevices;

                foreach (FilterInfo device in filterInfoCollection)
                {
                    VideoCaptureDevice videoCaptureDevice = new VideoCaptureDevice(device.MonikerString);

                    // only add device if it has video capabilities
                    if (videoCaptureDevice.VideoCapabilities.Length > 0)
                    {
                        cameraDevices.Add(
                            new CameraDevice
                            {
                                Name = device.Name,
                                MonikerString = device.MonikerString
                            });
                    }
                }
            }
            catch (Exception exception)
            {
                Console.WriteLine(exception);

                return cameraDevices;
            }

            return cameraDevices;
        }
开发者ID:brucedog,项目名称:homesecurityviewer,代码行数:35,代码来源:CameraService.cs


示例18: InputForm

		public InputForm()
		{
			InitializeComponent();
			// Disable panels at the beginning.
			pnlCamera.Enabled = false;
			pnlMjpeg.Enabled = false;
			pnlJpg.Enabled = false;
			try
			{
				filters = new FilterInfoCollection(FilterCategory.VideoInputDevice);

				if (filters.Count == 0)
					throw new ApplicationException();

				// add all devices to combo
				foreach (FilterInfo filter in filters)
				{
					deviceCombo.Items.Add(filter.Name);
				}
			}
			catch (ApplicationException)
			{
				deviceCombo.Items.Add("No local capture devices");
				deviceCombo.Enabled = false;
				rdoCaptureDevice.Enabled = false;
			}

			deviceCombo.SelectedIndex = 0;
		}
开发者ID:hpbaotho,项目名称:vsl,代码行数:29,代码来源:InputForm.cs


示例19: CaptureDeviceDialog

        /// <summary>
        ///   Initializes a new instance of the <see cref="CaptureDeviceDialog"/> class.
        /// </summary>
        /// 
        public CaptureDeviceDialog()
        {
            InitializeComponent();


            try // show device list
            {
                // enumerate video devices
                videoDevices = new FilterInfoCollection(FilterCategory.VideoInputDevice);

                if (videoDevices.Count == 0)
                    noDevices();

                // add all devices to combo
                foreach (FilterInfo device in videoDevices)
                {
                    devicesCombo.Items.Add(device.Name);
                }
            }
            catch (ApplicationException)
            {
                noDevices();
            }

            devicesCombo.SelectedIndex = 0;
        }
开发者ID:damy90,项目名称:Telerik-all,代码行数:30,代码来源:CaptureDeviceDialog.cs


示例20: getCamList

        public List<FilterInfo> getCamList()
        {
            List<FilterInfo> cameras = new List<FilterInfo>();
            try
            {
                videoDevices = new FilterInfoCollection(FilterCategory.VideoInputDevice);
                videoDeviceList = new VideoCaptureDeviceForm();

                if (videoDevices.Count == 0)
                {
                    throw new ApplicationException();
                }
                deviceExist = true;

                foreach (FilterInfo device in videoDevices)
                {
                    cameras.Add(device);
                }
            }
            catch (ApplicationException)
            {
                deviceExist = false;
                cameras = null;
            }
            return cameras;
        }
开发者ID:raze1392,项目名称:Motionizer,代码行数:26,代码来源:VideoDevice.cs



注:本文中的AForge.Video.DirectShow.FilterInfoCollection类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# DirectShow.VideoCaptureDevice类代码示例发布时间:2022-05-24
下一篇:
C# Video.NewFrameEventArgs类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap