Related products: Video Capture SDK .Net

Resize and crop in Video Capture SDK .Net

Resize

1. Enable resizing or cropping

VideoCapture1.Video_ResizeOrCrop_Enabled = true;

2. Set width and height, enable letterbox

VideoCapture1.Video_Resize = new VideoResizeSettings
{
    Width = 640,
    Height = 480,
    LetterBox = true
};

3. You can also select one of several resizing algorithms. They differ in quality and CPU usage. cbResizeMode fill with modes in default order.

switch (cbResizeMode.SelectedIndex)
{
  case 0: VideoCapture1.Video_Resize.Mode = VFResizeMode.NearestNeighbor; 
          break;
  case 1: VideoCapture1.Video_Resize.Mode = VFResizeMode.Bilinear; 
          break;
  case 2: VideoCapture1.Video_Resize.Mode = VFResizeMode.Bicubic; 
          break;
  case 3: VideoCapture1.Video_Resize.Mode = VFResizeMode.Lancroz; 
          break;
}

Crop

1. Enable resizing or cropping

VideoCapture1.Video_ResizeOrCrop_Enabled = true;

2. Set region

VideoCapture1.Video_Crop = new VideoCropSettings(40, 0, 40, 0);

VisioForge © 2006-2020

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