AForge.Video.DirectShow.VideoCaptureDevice.DisplayPropertyPage C# (CSharp) Method

DisplayPropertyPage() public method

Display property window for the video capture device providing its configuration capabilities.

If you pass parent window's handle to this method, then the displayed property page will become modal window and none of the controls from the parent window will be accessible. In order to make it modeless it is required to pass IntPtr.Zero as parent window's handle.

The video source does not support configuration property page.
public DisplayPropertyPage ( IntPtr parentWindow ) : void
parentWindow System.IntPtr Handle of parent window.
return void
        public void DisplayPropertyPage( IntPtr parentWindow )
        {
            // check source
            if ( ( deviceMoniker == null ) || ( deviceMoniker == string.Empty ) )
                throw new ArgumentException( "Video source is not specified." );

            lock ( sync )
            {
                if ( IsRunning )
                {
                    // pass the request to backgroud thread if video source is running
                    parentWindowForPropertyPage = parentWindow;
                    needToDisplayPropertyPage = true;
                    return;
                }

                object tempSourceObject = null;

                // create source device's object
                try
                {
                    tempSourceObject = FilterInfo.CreateFilter( deviceMoniker );
                }
                catch
                {
                    throw new ApplicationException( "Failed creating device object for moniker." );
                }

                if ( !( tempSourceObject is ISpecifyPropertyPages ) )
                {
                    throw new NotSupportedException( "The video source does not support configuration property page." );
                }

                DisplayPropertyPage( parentWindow, tempSourceObject );

                Marshal.ReleaseComObject( tempSourceObject );
            }
        }

Same methods

VideoCaptureDevice::DisplayPropertyPage ( IntPtr parentWindow, object sourceObject ) : void

Usage Example

 private void bttnCamProp_Click(object sender, EventArgs e)
 {
     VideoCaptureDevice localSource = new VideoCaptureDevice(CameraRig.rig[CameraRig.activeCam].cameraName);
     localSource.DisplayPropertyPage(IntPtr.Zero); // non-modal
 }
All Usage Examples Of AForge.Video.DirectShow.VideoCaptureDevice::DisplayPropertyPage