mirror of
https://github.com/rosenbjerg/FFMpegCore.git
synced 2024-11-10 08:34:12 +01:00
parent
bf5e732ad5
commit
2fa9255d40
1 changed files with 6 additions and 6 deletions
|
@ -75,18 +75,18 @@ public static Bitmap Snapshot(MediaAnalysis source, Size? size = null, TimeSpan?
|
||||||
{
|
{
|
||||||
if (size.Value.Width == 0)
|
if (size.Value.Width == 0)
|
||||||
{
|
{
|
||||||
var ratio = source.PrimaryVideoStream.Height / (double) size.Value.Height;
|
var ratio = (double)size.Value.Height / source.PrimaryVideoStream.Height;
|
||||||
|
|
||||||
size = new Size((int) (source.PrimaryVideoStream.Width * ratio),
|
size = new Size((int)(source.PrimaryVideoStream.Width * ratio),
|
||||||
(int) (source.PrimaryVideoStream.Height * ratio));
|
(int)(source.PrimaryVideoStream.Height * ratio));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (size.Value.Height == 0)
|
if (size.Value.Height == 0)
|
||||||
{
|
{
|
||||||
var ratio = source.PrimaryVideoStream.Width / (double) size.Value.Width;
|
var ratio = (double)size.Value.Width / source.PrimaryVideoStream.Width;
|
||||||
|
|
||||||
size = new Size((int) (source.PrimaryVideoStream.Width * ratio),
|
size = new Size((int)(source.PrimaryVideoStream.Width * ratio),
|
||||||
(int) (source.PrimaryVideoStream.Height * ratio));
|
(int)(source.PrimaryVideoStream.Height * ratio));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue