Prechádzať zdrojové kódy

页面编辑-提交自定义插入窗口相关内容

ZhouJieSheng 2 rokov pred
rodič
commit
dbd6931873

+ 31 - 0
PDF Office/DataConvert/FileToImageSourceConvert.cs

@@ -0,0 +1,31 @@
+using System;
+using System.Collections.Generic;
+using System.Globalization;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Data;
+using System.Windows.Media.Imaging;
+
+namespace PDF_Office.DataConvert
+{
+    /// <summary>
+    /// 文件绝对路径 转ImageSource  转换器
+    /// </summary>
+    public class FileToImageSourceConvert : IValueConverter
+    {
+        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
+        {
+            if(!string.IsNullOrEmpty((string)value)&&System.IO.File.Exists((string)value))
+            {
+                return new BitmapImage(new Uri((string)value, UriKind.Relative));
+            }
+            return null;
+        }
+
+        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
+        {
+            throw new NotImplementedException();
+        }
+    }
+}

+ 26 - 0
PDF Office/Model/PageEdit/CustomInsertModel.cs

@@ -0,0 +1,26 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace PDF_Office.Model.PageEdit
+{
+    public class CustomInsertModel
+    {
+        /// <summary>
+        /// 图片路径
+        /// </summary>
+        public string filepath { get; set; }
+
+        /// <summary>
+        /// 页面宽度
+        /// </summary>
+        public int width { get; set; }
+
+        /// <summary>
+        /// 页面高度
+        /// </summary>
+        public int height { get; set; }
+    }
+}

+ 24 - 0
PDF Office/Model/PageEdit/CustomPageItem.cs

@@ -0,0 +1,24 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace PDF_Office.Model.PageEdit
+{
+    /// <summary>
+    /// 插入自定义页面的 页面项
+    /// </summary>
+    public class CustomPageItem
+    {
+        /// <summary>
+        /// 名称
+        /// </summary>
+        public string Name { get; set; }
+
+        /// <summary>
+        /// 图片路径
+        /// </summary>
+        public string FilePath { get; set; }
+    }
+}

BIN
PDF Office/Resources/PageEdit/GridLine.png


BIN
PDF Office/Resources/PageEdit/HorizontalLine.png


BIN
PDF Office/Resources/PageEdit/Staff.png