On LetterBox make a Pillarbox if aspect ratio is equal
If background video and Vocaluxe have the same aspect ratio, switching to aspect ratio LetterBox would do a Pillarbox, so you can add 4:3 borders, if a video file has the wrong aspect ratio (maybe SAR value at 16:9, but a DAR value at 4:3). Without this change, LetterBox would do exactly the same as Crop in this special case.
This commit is contained in:
1 parent
0d56cc4faf
commit
94aa28112d
1 file changed
+9
-3
@@ -1,4 +1,4 @@
|
||||
#region license
|
||||
#region license
|
||||
// This file is part of Vocaluxe.
|
||||
//
|
||||
// Vocaluxe is free software: you can redistribute it and/or modify
|
||||
@@ -101,6 +101,7 @@ namespace VocaluxeLib
|
||||
|
||||
switch (aspect)
|
||||
{
|
||||
case EAspect.Automatic:
|
||||
case EAspect.Crop:
|
||||
if (boundsAspectRatio >= aspectRatio)
|
||||
{
|
||||
@@ -138,7 +139,12 @@ namespace VocaluxeLib
|
||||
}
|
||||
break;
|
||||
case EAspect.LetterBox:
|
||||
if (boundsAspectRatio <= aspectRatio)
|
||||
if (boundsAspectRatio == aspectRatio) // Pillarbox
|
||||
{
|
||||
scaledWidth = bounds.W * 0.77f;
|
||||
scaledHeight = bounds.W / aspectRatio;
|
||||
}
|
||||
else if (boundsAspectRatio < aspectRatio)
|
||||
{
|
||||
scaledWidth = bounds.W;
|
||||
scaledHeight = bounds.W / aspectRatio;
|
||||
@@ -306,4 +312,4 @@ namespace VocaluxeLib
|
||||
return bmp;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user