ScreenToGif.Webcam.DirectX.CaptureWebcam.StartPreview C# (CSharp) Method

StartPreview() public method

Starts the video preview from the video source.
public StartPreview ( ) : void
return void
        public void StartPreview()
        {
            DerenderGraph();

            WantPreviewRendered = ((PreviewWindow != null) && (VideoDevice != null));

            RenderGraph();
            StartPreviewIfNeeded();
        }

Usage Example

        public void Refresh()
        {
            //To change the video device, a dispose is needed.
            if (Capture != null)
            {
                Capture.Dispose();
                Capture = null;
            }

            //Create capture object.
            if (VideoDevice != null)
            {
                Capture = new CaptureWebcam(VideoDevice) { PreviewWindow = this, Scale = this.Scale() };
                Capture.StartPreview();

                //Width = Height * ((double)Capture.Width / (double)Capture.Height);
            }
        }
All Usage Examples Of ScreenToGif.Webcam.DirectX.CaptureWebcam::StartPreview