liyijie 2 tahun lalu
induk
melakukan
9ada879741

+ 6 - 9
PDF Office/Helper/EditToolsHelper.cs

@@ -16,23 +16,20 @@ using static Dropbox.Api.TeamLog.PaperDownloadFormat;
 using Microsoft.Office.Interop.Word;
 using Task = System.Threading.Tasks.Task;
 using System.Drawing.Imaging;
+using System.Windows.Media;
 
 namespace PDF_Office.Helper
 {
     public static class EditToolsHelper
     {
-        private static byte[] BitmapData = null;
+      
 
-        private static int Width=0;
-
-        private static int Height=0;
-
-        public static byte[] ConvertColor(string color)
+        public static byte[] ConvertColor(Color color)
         {
             byte[] rgb_array = new byte[] { 0, 0, 0 };
-            rgb_array[0] = (byte)(color[1] * 15 + color[2]);
-            rgb_array[1] = (byte)(color[3] * 15 + color[4]);
-            rgb_array[2] = (byte)(color[5] * 15 + color[6]);
+            rgb_array[0] = color.R;
+            rgb_array[1] = color.G;
+            rgb_array[2] = color.B;
             return rgb_array;
         }
 

+ 1 - 1
PDF Office/ViewModels/EditTools/Background/BackgroundCreateColorContentViewModel.cs

@@ -124,7 +124,7 @@ namespace PDF_Office.ViewModels.EditTools.Background
             set
             {
                 SetProperty(ref _stringColor, value);
-                BackgroundInfo.Color = EditToolsHelper.ConvertColor(value); ;
+                //BackgroundInfo.Color = EditToolsHelper.ConvertColor(value); ;
             }
         }
 

+ 6 - 5
PDF Office/ViewModels/EditTools/Watermark/WatermarkCreateFileContentViewModel.cs

@@ -191,6 +191,7 @@ namespace PDF_Office.ViewModels.EditTools.Watermark
             {
                 SetProperty(ref _pageRangeSelectIndex, value);
                 EditToolsHelper.GetPageRange(PageRangeSelectIndex, PDFViewer.Document, ref WatermarkInfo.PageRange, PageRangeText);
+
             }
         }
 
@@ -215,11 +216,11 @@ namespace PDF_Office.ViewModels.EditTools.Watermark
             }
         }
 
-        private Visibility _creatFileVisible = Visibility.Collapsed;
-        public Visibility CreatFileVisible
+        private Visibility _createFileVisible = Visibility.Collapsed;
+        public Visibility CreateFileVisible
         {
-            get { return _creatFileVisible; }
-            set { SetProperty(ref _creatFileVisible, value); }
+            get { return _createFileVisible; }
+            set { SetProperty(ref _createFileVisible, value); }
         }
 
         private ObservableDictionary<string, bool> _getLocationFromNumber = new ObservableDictionary<string, bool>();
@@ -319,7 +320,7 @@ namespace PDF_Office.ViewModels.EditTools.Watermark
                 {
                     EditToolsHelper.ChooseFile(dlg.FileName, ref WatermarkInfo);
                 }
-                CreatFileVisible=Visibility.Visible;
+                CreateFileVisible=Visibility.Visible;
             }
         }
 

+ 4 - 4
PDF Office/ViewModels/EditTools/Watermark/WatermarkCreateTextContentViewModel.cs

@@ -267,8 +267,8 @@ namespace PDF_Office.ViewModels.EditTools.Watermark
             }
         }
 
-        private string _stringColor = "#FF0000";
-        public string StringColor
+        private Color _stringColor= Color.FromArgb(0xFF, 0xFF, 0x00, 0x00);
+        public Color StringColor
         {
             get
             {
@@ -309,7 +309,7 @@ namespace PDF_Office.ViewModels.EditTools.Watermark
         {
             this.eventAggregator=eventAggregator;
             WatermarkInfo.WatermarkType = C_Watermark_Type.WATERMARK_TYPE_TEXT;
-            StringColor = "#FFFF00";
+            StringColor = Color.FromArgb(0xFF, 0xFF, 0x00, 0x00);
             ChangeLocationCommand = new DelegateCommand<object>(ChangeLocation);
             SelectedColorChangedCommand = new DelegateCommand<object>(SelectedColorChanged_Click);
             InitList();
@@ -354,7 +354,7 @@ namespace PDF_Office.ViewModels.EditTools.Watermark
                 if (colorValue != null)
                 {
 
-                    StringColor = colorValue.ToString();
+                    StringColor = colorValue;
                 }
             }
         }

+ 0 - 2
PDF Office/ViewModels/EditTools/Watermark/WatermarkDocumentContentViewModel.cs

@@ -100,8 +100,6 @@ namespace PDF_Office.ViewModels.EditTools.Watermark
                 Int32Rect.Empty,
                 System.Windows.Media.Imaging.BitmapSizeOptions.FromEmptyOptions()
             );
-            ;
-
             return bs;
         }
 

+ 1 - 1
PDF Office/Views/EditTools/Watermark/WatermarkCreateFileContent.xaml

@@ -20,7 +20,7 @@
                 <Button Content="+" Width="32" Height="32" Margin="8,0,0,0" Command="{Binding OpenFileCommand}"></Button>
             </StackPanel>
         </Grid>
-        <Grid Grid.Row="1" Visibility="{Binding CreatFileVisible}">
+        <Grid Grid.Row="1" Visibility="{Binding CreateFileVisible}">
             <Grid.RowDefinitions>
                 <RowDefinition Height="197"/>
                 <RowDefinition Height="200"/>

+ 1 - 1
PDF Office/Views/EditTools/Watermark/WatermarkCreateTextContent.xaml

@@ -42,7 +42,7 @@
                 <StackPanel Orientation="Horizontal" Margin="0,8,0,0">
                     <StackPanel Orientation="Horizontal">
                         <TextBlock Width="24" Height="24" Background="CadetBlue"></TextBlock>
-                        <cus:CommonWritableComboBox Width="66" Height="32" Margin="8,0,0,0" TypeSouce="{Binding RotationList}" Minimum="-360" Maximum="360" Unit=" " Text="0" Value="{Binding RotationValue,Mode=TwoWay}"></cus:CommonWritableComboBox>
+                        <cus:CommonWritableComboBox  Width="66" Height="32" Margin="8,0,0,0" TypeSouce="{Binding RotationList}" Minimum="-360" Maximum="360" Unit=" " Text="0" Value="{Binding RotationValue,Mode=TwoWay}"></cus:CommonWritableComboBox>
                     </StackPanel>
                     <StackPanel Orientation="Horizontal" Margin="28,0,0,0">
                         <TextBlock Width="24" Height="24" Background="CadetBlue"></TextBlock>