Enum VideoRendererStretchMode
- Namespace
- VisioForge.Core.Types
- Assembly
- VisioForge.Core.dll
Specifies how video frames are scaled or stretched to fit the display area of a video renderer. This enumeration controls the aspect ratio preservation and filling behavior.
public enum VideoRendererStretchModeFields
Letterbox = 0-
Preserves the video's original aspect ratio by adding black bars (letterboxing or pillarboxing) to fill any empty space in the display area.
Stretch = 1-
Stretches the video to fill the entire display area, ignoring its original aspect ratio. This may result in a distorted image if the aspect ratios do not match.
LetterboxToFill = 2-
Stretches the video to fill the entire display area while preserving its aspect ratio. This is achieved by cropping the video if its aspect ratio does not match the display area. This mode is typically available for WPF renderers.
Remarks
The choice of stretch mode affects how the video appears when its aspect ratio differs from the display area. Some modes preserve the aspect ratio by adding black bars (letterboxing/pillarboxing), while others stretch or crop the video to fill the entire area. Letterbox mode is ideal for preserving the original content without distortion, adding black bars as needed. Stretch mode fills the entire display area but may distort the image if aspect ratios don't match - use with caution. LetterboxToFill (also called zoom or crop) maintains aspect ratio by cropping excess content, useful for filling modern widescreen displays with 4:3 content. The best choice depends on the application: content preservation (Letterbox), screen filling (Stretch), or a balance (LetterboxToFill). Most media players default to Letterbox mode to avoid distortion.