public static class VideoFitWorks out where a picture goes.
No guide page documents this yet — the page shows what the code says about itself.
Remarks
Pure arithmetic over four numbers, in Vixen.Video rather than in whichever renderer needed it first — because both of them need it and they must agree. A video drawn in a scene and the same video drawn in a user interface panel that letterboxed differently would be a difference nobody could explain and nothing could test.
The display aspect is taken separately from the pixel size, which is the whole reason anamorphic content works: a 720×480 clip meant to be shown at 853×480 has square-ish samples that are not square, and fitting it by its sample count squashes it.
Methods (2)
public static VideoPlacement Place(VideoScaling scaling, Vector2 source, Rectangle target)Places a picture in a rectangle.
public static VideoPlacement Place(VideoScaling scaling, VideoPlayer source, Rectangle target)Places a picture in a rectangle, at the size the container says it is meant to look.
Used by (3)
- VideoGameVideoPlayback
- VideoFitTestsVixen.Video.Tests
- VideoSurfaceUploaderVixen.Video.Rendering