Resize and crop
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
switch (cbResizeMode.SelectedIndex)
{
case 0: VideoCapture1.Video_Resize.Mode = VideoResizeMode.NearestNeighbor;
break;
case 1: VideoCapture1.Video_Resize.Mode = VideoResizeMode.Bilinear;
break;
case 2: VideoCapture1.Video_Resize.Mode = VideoResizeMode.Bicubic;
break;
case 3: VideoCapture1.Video_Resize.Mode = VideoResizeMode.Lancroz;
break;
}
Sample code - video crop
1. Enable resizing/cropping
VideoCapture1.Video_ResizeOrCrop_Enabled = true;
2. Set region
VideoCapture1.Video_Crop = new VideoCropSettings(40, 0, 40, 0);
Required redists
How to install the required redists or deploy them to the user's PC?
Visit our GitHub page to get more code samples.