mirror of
https://github.com/rosenbjerg/FFMpegCore.git
synced 2025-01-19 04:56:43 +00:00
parent
bf5e732ad5
commit
2fa9255d40
1 changed files with 6 additions and 6 deletions
|
@ -75,7 +75,7 @@ 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));
|
||||||
|
@ -83,7 +83,7 @@ public static Bitmap Snapshot(MediaAnalysis source, Size? size = null, TimeSpan?
|
||||||
|
|
||||||
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