This commit is contained in:
2025-07-28 14:45:37 +08:00
parent f03733da04
commit f4a67e2822
2 changed files with 7 additions and 3 deletions
+2 -1
View File
@@ -104,7 +104,8 @@ namespace Ink_Canvas {
{ {
Source = new BitmapImage(new Uri(info.SourcePath)), Source = new BitmapImage(new Uri(info.SourcePath)),
Width = info.Width, Width = info.Width,
Height = info.Height Height = info.Height,
Stretch = Enum.TryParse<Stretch>(info.Stretch, out var stretch) ? stretch : Stretch.Fill
}; };
InkCanvas.SetLeft(img, info.Left); InkCanvas.SetLeft(img, info.Left);
InkCanvas.SetTop(img, info.Top); InkCanvas.SetTop(img, info.Top);
@@ -22,6 +22,7 @@ namespace Ink_Canvas {
public double Top { get; set; } public double Top { get; set; }
public double Width { get; set; } public double Width { get; set; }
public double Height { get; set; } public double Height { get; set; }
public string Stretch { get; set; } = "Fill"; // 默认为Fill
} }
public partial class MainWindow : Window { public partial class MainWindow : Window {
private void SymbolIconSaveStrokes_MouseUp(object sender, MouseButtonEventArgs e) { private void SymbolIconSaveStrokes_MouseUp(object sender, MouseButtonEventArgs e) {
@@ -129,7 +130,8 @@ namespace Ink_Canvas {
Left = InkCanvas.GetLeft(img), Left = InkCanvas.GetLeft(img),
Top = InkCanvas.GetTop(img), Top = InkCanvas.GetTop(img),
Width = img.Width, 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)), Source = new BitmapImage(new Uri(info.SourcePath)),
Width = info.Width, Width = info.Width,
Height = info.Height Height = info.Height,
Stretch = Enum.TryParse<Stretch>(info.Stretch, out var stretch) ? stretch : Stretch.Fill
}; };
InkCanvas.SetLeft(img, info.Left); InkCanvas.SetLeft(img, info.Left);
InkCanvas.SetTop(img, info.Top); InkCanvas.SetTop(img, info.Top);