Resize and crop in Video Capture SDK .Net

Related products
Video Capture SDK .Net

Sample code - video 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. Select one of several resizing algorithms

They differ in quality and CPU usage. cbResizeMode filled 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;
}

Sample code - video crop

1. Enable resizing or cropping

VideoCapture1.Video_ResizeOrCrop_Enabled = true;

2. Set region

VideoCapture1.Video_Crop = new VideoCropSettings(40, 0, 40, 0);
Please contact support to get help with this tutorial. Visit our GitHub page to get more code samples.
abstract 2abstract 1abstract 3
logo
VisioForge © 2006 - 2021