Code sample - Select video renderer (WinForms)

You can use 3 different filters to render video - Video Renderer (legacy), Video Mixing Renderer 9, and Enhanced Video Renderer (in Windows Vista and later).
"VideoRenderer" value uses GDI for drawing. It does not use hardware acceleration and can be used only for compatibility purposes and if DirectX 9 or later is not installed.

Sample code

VideoCapture1.Video_Renderer.VideoRenderer = VideoRendererMode.EVR;

Video Mixing Renderer 9 is an up-to-date filter recommended for use. It can use all capabilities of your video card, such as hardware acceleration, while displaying and deinterlacing the image.

VideoCapture1.Video_Renderer.VideoRenderer = VideoRendererMode.VMR9;

Use the following code to get the list of available deinterlacing modes:


foreach (string deinterlaceMode in VideoCapture1.Video_Renderer_Deinterlace_Modes())

Enhanced Video Renderer is a new filter available in Windows Vista and later. It can use additional video acceleration features and is recommended to be used if available.

VideoCapture1.Video_Renderer.VideoRenderer = VideoRendererMode.EVR;

When the image is being displayed, the aspect ratio of the source video may not correspond to the size of the screen used for display.

Use the following code to stretch the image:

VideoCapture1.Video_Renderer.StretchMode = VideoRendererStretchMode.Stretch;

Use the following code to use black borders instead of stretching (letterbox):

VideoCapture1.Video_Renderer.StretchMode = VideoRendererStretchMode.Letterbox;
Please contact support to get help with this tutorial. Visit our GitHub page to get more code samples.
abstract 2abstract 1abstract 3
VisioForge © 2006 - 2022