From f4a67e2822f5b1ad7fe875c732fa75aa85ed2e4f Mon Sep 17 00:00:00 2001 From: CJKmkp <2564608840@qq.com> Date: Mon, 28 Jul 2025 14:45:37 +0800 Subject: [PATCH] fix:issue #93 --- Ink Canvas/MainWindow_cs/MW_BoardControls.cs | 3 ++- Ink Canvas/MainWindow_cs/MW_Save&OpenStrokes.cs | 7 +++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/Ink Canvas/MainWindow_cs/MW_BoardControls.cs b/Ink Canvas/MainWindow_cs/MW_BoardControls.cs index d52fed64..89b5ea5b 100644 --- a/Ink Canvas/MainWindow_cs/MW_BoardControls.cs +++ b/Ink Canvas/MainWindow_cs/MW_BoardControls.cs @@ -104,7 +104,8 @@ namespace Ink_Canvas { { Source = new BitmapImage(new Uri(info.SourcePath)), Width = info.Width, - Height = info.Height + Height = info.Height, + Stretch = Enum.TryParse(info.Stretch, out var stretch) ? stretch : Stretch.Fill }; InkCanvas.SetLeft(img, info.Left); InkCanvas.SetTop(img, info.Top); diff --git a/Ink Canvas/MainWindow_cs/MW_Save&OpenStrokes.cs b/Ink Canvas/MainWindow_cs/MW_Save&OpenStrokes.cs index da1d565b..8fc996b1 100644 --- a/Ink Canvas/MainWindow_cs/MW_Save&OpenStrokes.cs +++ b/Ink Canvas/MainWindow_cs/MW_Save&OpenStrokes.cs @@ -22,6 +22,7 @@ namespace Ink_Canvas { public double Top { get; set; } public double Width { get; set; } public double Height { get; set; } + public string Stretch { get; set; } = "Fill"; // 默认为Fill } public partial class MainWindow : Window { private void SymbolIconSaveStrokes_MouseUp(object sender, MouseButtonEventArgs e) { @@ -129,7 +130,8 @@ namespace Ink_Canvas { Left = InkCanvas.GetLeft(img), Top = InkCanvas.GetTop(img), Width = img.Width, - Height = img.Height + Height = img.Height, + Stretch = img.Stretch.ToString() }); } } @@ -612,7 +614,8 @@ namespace Ink_Canvas { { Source = new BitmapImage(new Uri(info.SourcePath)), Width = info.Width, - Height = info.Height + Height = info.Height, + Stretch = Enum.TryParse(info.Stretch, out var stretch) ? stretch : Stretch.Fill }; InkCanvas.SetLeft(img, info.Left); InkCanvas.SetTop(img, info.Top);