Code sample - Select video renderer (WinForms only)

You are can use 3 different filters to render video - Video Renderer, Video Mixing Renderer 9 and Enhanced Video Renderer (in Windows Vista and later).

Video Renderer 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.

VideoCapture1.Video_Renderer = VFVideoRenderer.VideoRenderer;

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 = VFVideoRenderer.VMR9;

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

VideoCapture1.Video_Renderer_Deinterlace_Modes_Fill();

foreach (string deinterlaceMode in VideoCapture1.Video_Renderer_Deinterlace_Modes())
{
  cbDeinterlaceModes.Items.Add(deinterlaceMode);
}

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 = VFVideoRenderer.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 displaying.

 

Use the following code to stretch the image:

VideoCapture1.Screen_Stretch = true;
VideoCapture1.Screen_Update();

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

VideoCapture1.Screen_Stretch = false;
VideoCapture1.Screen_Update();

VisioForge © 2006-2020

  • GitHub-Mark-64px
  • Twitter Социальные Иконка
  • VisioForge Facebook page
  • YouTube channel