diff --git a/Azaion.Annotator/PlayerControlHandler.cs b/Azaion.Annotator/PlayerControlHandler.cs index 29abc8a..f50c0b3 100644 --- a/Azaion.Annotator/PlayerControlHandler.cs +++ b/Azaion.Annotator/PlayerControlHandler.cs @@ -4,6 +4,7 @@ using System.Windows.Input; using Azaion.Annotator.DTO; using LibVLCSharp.Shared; using MediatR; +using MS.WindowsAPICodePack.Internal; namespace Azaion.Annotator; @@ -15,6 +16,7 @@ public class PlayerControlHandler(LibVLC libVLC, MediaPlayer mediaPlayer, MainWi { private const int STEP = 20; private const int LARGE_STEP = 5000; + private const int RESULT_WIDTH = 1280; private static readonly string[] CatchSenders = ["ForegroundWindow", "ScrollViewer", "VideoView"]; @@ -193,7 +195,10 @@ public class PlayerControlHandler(LibVLC libVLC, MediaPlayer mediaPlayer, MainWi Directory.CreateDirectory(config.ImagesDirectory); await File.WriteAllTextAsync($"{config.LabelsDirectory}/{fName}.txt", labels); - mediaPlayer.TakeSnapshot(0, $"{config.ImagesDirectory}/{fName}.jpg", 0, 0); + + var resultHeight = (uint)Math.Round(RESULT_WIDTH / formState.CurrentVideoSize.Width * formState.CurrentVideoSize.Height); + + mediaPlayer.TakeSnapshot(0, $"{config.ImagesDirectory}/{fName}.jpg", RESULT_WIDTH, resultHeight); mainWindow.Annotations[fName] = currentAnns; mainWindow.Editor.RemoveAllAnns();