Преглед на файлове

注释列表-手绘缩略图问题

OYXH\oyxh преди 2 години
родител
ревизия
93826d6355
променени са 2 файла, в които са добавени 14 реда и са изтрити 1 реда
  1. 1 1
      PDF Office/Views/BOTA/AnnotationListItem.xaml
  2. 13 0
      PDF Office/Views/BOTA/AnnotationListItem.xaml.cs

+ 1 - 1
PDF Office/Views/BOTA/AnnotationListItem.xaml

@@ -358,7 +358,7 @@
 
             <Image
                 Name="ImageContext"
-                Grid.Row="1"
+                Grid.Row="1" Stretch="Fill "
                 Source="{Binding WriteableBitmap}" />
             <TextBlock
                 Name="TxbContent"

+ 13 - 0
PDF Office/Views/BOTA/AnnotationListItem.xaml.cs

@@ -76,6 +76,19 @@ namespace PDF_Office.Views.BOTA
 
                     TxbMarkupContent.Visibility = Visibility.Collapsed;
 
+                    if (args.WriteableBitmap.Width > 180)
+                    {
+                        ImageContext.Stretch = Stretch.Fill;
+                    }
+                    else if (args.WriteableBitmap.Width > 100)
+                    {
+                        ImageContext.Stretch = Stretch.Fill;
+                    }
+                    else
+                    {
+                        ImageContext.Stretch = Stretch.None;
+                    }
+
                     //var encoder = new PngBitmapEncoder();
                     //encoder.Frames.Add(BitmapFrame.Create((BitmapSource)ImageContext.Source));
                     //FileStream file = new FileStream(String.Format($@"C:\Users\oyxh\Desktop\images\PDFText\{data.AnnotIndex}.png"), FileMode.Create);