Class CropVideoEffect
- Namespace
- VisioForge.Core.Types.X.VideoEffects
- Assembly
- VisioForge.Core.dll
Represents a video crop effect that removes pixels from the edges of video frames.
public class CropVideoEffect : BaseVideoEffect, IBaseVideoEffect, IVideoEditXVideoEffectInheritance
Implements
Inherited Members
Remarks
SDK Availability: VideoCaptureCoreX, MediaPlayerCoreX, VideoEditCoreX, Media Blocks SDK
Platform Support: Windows, Linux, macOS, Android, iOS
The crop effect removes specified numbers of pixels from each edge of the video frame, effectively reducing the frame dimensions. This is useful for removing unwanted borders, changing aspect ratios, or focusing on a specific region of interest.
Key Features:
- Edge-Based Cropping: Specify pixels to remove from each edge independently
- Zero-Copy Operation: Efficient implementation without frame buffer copying
- Time Control: Optional start/stop time for VideoEditCoreX
- Rectangle Constructor: Convenient initialization from Rect object
Common Use Cases:
- Removing black bars (letterboxing/pillarboxing)
- Converting aspect ratios (16:9 to 4:3, etc.)
- Removing camera artifacts or unwanted edges
- Extracting regions of interest
- Preparing video for specific display formats
For Classic SDK, crop functionality is available through VideoEffectPan (Windows only).
Performance Note: Cropping is a very efficient operation as it manipulates frame metadata rather than pixel data. Has minimal CPU impact and can be combined with other effects.
Constructors
CropVideoEffect(int, int, int, int)
Initializes a new instance of the VisioForge.Core.Types.X.VideoEffects.CropVideoEffect class.
public CropVideoEffect(int left, int top, int right, int bottom)Parameters
leftint-
The number of pixels to crop from the left edge.
topint-
The number of pixels to crop from the top edge.
rightint-
The number of pixels to crop from the right edge.
bottomint-
The number of pixels to crop from the bottom edge.
CropVideoEffect(Rect)
Initializes a new instance of the VisioForge.Core.Types.X.VideoEffects.CropVideoEffect class.
public CropVideoEffect(Rect rect)Parameters
rectRect-
The rectangle defining the crop boundaries.
Fields
DefaultName
The default name.
public static string DefaultNameField Value
Properties
Bottom
Gets the pixels to crop at bottom.
public int Bottom { get; }Property Value
Left
Gets the pixels to crop at left.
public int Left { get; }Property Value
Right
Gets the pixels to crop at right.
public int Right { get; }Property Value
StartTime
Gets or sets the start time. Used only in VideoEditCoreX.
public TimeSpan StartTime { get; set; }Property Value
StopTime
Gets or sets the stop time. Used only in VideoEditCoreX.
public TimeSpan StopTime { get; set; }Property Value
Top
Gets the pixels to crop at top.
public int Top { get; }Property Value
Methods
GenerateDescription()
Generates the description.
public string GenerateDescription()Returns
- string
-
A string containing the GStreamer element description for the videocrop effect.