mirror of
https://github.com/azaion/annotations.git
synced 2026-04-22 09:06:30 +00:00
fix show image, fix zoom
This commit is contained in:
@@ -40,8 +40,7 @@ public partial class Annotator
|
||||
private readonly IDbFactory _dbFactory;
|
||||
private readonly IInferenceService _inferenceService;
|
||||
private readonly IInferenceClient _inferenceClient;
|
||||
|
||||
private ObservableCollection<DetectionClass> AnnotationClasses { get; set; } = new();
|
||||
|
||||
private bool _suspendLayout;
|
||||
private bool _gpsPanelVisible = false;
|
||||
|
||||
@@ -181,21 +180,22 @@ public partial class Annotator
|
||||
{
|
||||
if (_formState.CurrentMrl == _mediaPlayer.Media?.Mrl)
|
||||
return; //already loaded all the info
|
||||
|
||||
|
||||
await Dispatcher.Invoke(async () => await ReloadAnnotations());
|
||||
|
||||
//show image
|
||||
if (_formState.CurrentMedia?.MediaType == MediaTypes.Image)
|
||||
{
|
||||
await Task.Delay(100); //wait to load the frame and set on pause
|
||||
ShowTimeAnnotations(TimeSpan.FromMilliseconds(_mediaPlayer.Time), showImage: true);
|
||||
return;
|
||||
}
|
||||
|
||||
_formState.CurrentMrl = _mediaPlayer.Media?.Mrl ?? "";
|
||||
uint vw = 0, vh = 0;
|
||||
_mediaPlayer.Size(0, ref vw, ref vh);
|
||||
_formState.CurrentVideoSize = new Size(vw, vh);
|
||||
_formState.CurrentVideoLength = TimeSpan.FromMilliseconds(_mediaPlayer.Length);
|
||||
|
||||
await Dispatcher.Invoke(async () => await ReloadAnnotations());
|
||||
|
||||
if (_formState.CurrentMedia?.MediaType == MediaTypes.Image)
|
||||
{
|
||||
await Task.Delay(100); //wait to load the frame and set on pause
|
||||
ShowTimeAnnotations(TimeSpan.FromMilliseconds(_mediaPlayer.Time));
|
||||
_mediaPlayer.SetPause(true);
|
||||
}
|
||||
};
|
||||
|
||||
LvFiles.MouseDoubleClick += async (_, _) =>
|
||||
@@ -268,7 +268,7 @@ public partial class Annotator
|
||||
Editor.ClearExpiredAnnotations(res.Annotation.Time);
|
||||
});
|
||||
|
||||
ShowAnnotations(res.Annotation, showImage: true);
|
||||
ShowAnnotation(res.Annotation, showImage: true);
|
||||
}
|
||||
private void SaveUserSettings()
|
||||
{
|
||||
@@ -281,7 +281,7 @@ public partial class Annotator
|
||||
_configUpdater.Save(_appConfig);
|
||||
}
|
||||
|
||||
private void ShowTimeAnnotations(TimeSpan time)
|
||||
private void ShowTimeAnnotations(TimeSpan time, bool showImage = false)
|
||||
{
|
||||
Dispatcher.Invoke(() =>
|
||||
{
|
||||
@@ -290,10 +290,10 @@ public partial class Annotator
|
||||
Editor.ClearExpiredAnnotations(time);
|
||||
});
|
||||
|
||||
ShowAnnotations(TimedAnnotations.Query(time).FirstOrDefault());
|
||||
ShowAnnotation(TimedAnnotations.Query(time).FirstOrDefault(), showImage);
|
||||
}
|
||||
|
||||
private void ShowAnnotations(Annotation? annotation, bool showImage = false)
|
||||
private void ShowAnnotation(Annotation? annotation, bool showImage = false)
|
||||
{
|
||||
if (annotation == null)
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user