Browse Source

注释-内容选择工具-裁剪

OYXH\oyxh 2 năm trước cách đây
mục cha
commit
778c3e540a

+ 2 - 2
PDF Office/Styles/ButtonStyle.xaml

@@ -390,8 +390,8 @@
     </ControlTemplate>
 
     <!--
-    Style for Btn.cta
-    样式里仅设置了背景色和文字颜色变化,字体大小和控件宽度需要调用时设置
+        Style for Btn.cta
+        样式里仅设置了背景色和文字颜色变化,字体大小和控件宽度需要调用时设置
     -->
     <Style x:Key="Btn.cta" TargetType="{x:Type Button}">
         <Setter Property="FocusVisualStyle" Value="{x:Null}" />

+ 6 - 1
PDF Office/ViewModels/PropertyPanel/AnnotPanel/SnapshotEditMenuViewModel.cs

@@ -98,7 +98,12 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
         {
             if (SnapToolArgs != null && PDFViewer != null && PDFViewer.ToolManager != null)
             {
-                SnapToolArgs.SaveSnapshotToClipboard();
+                Rect rect = SnapToolArgs.GetSnapshotPDFRect(out int CurrentIndex);
+                List<int> cropPageList = new List<int>();
+                cropPageList.Add(CurrentIndex);
+                PDFViewer?.CropPage(0, rect, cropPageList);
+                PDFViewer.GoToPage(CurrentIndex);
+                PDFViewer.UndoManager.CanSave = true;
                 PDFViewer.SetMouseMode(MouseModes.PanTool);
                 if (SnapToolEvent != null)
                 {

+ 13 - 10
PDF Office/ViewModels/Tools/AnnotToolContentViewModel.Function.cs

@@ -62,8 +62,7 @@ namespace PDF_Office.ViewModels.Tools
 
         private void InitAnnotUnderline()
         {
-    
-               DefaultAnnotProperty annotProperty = SettingHelper.GetAnnotDefaultProperty(AnnotArgsType.AnnotUnderline);
+            DefaultAnnotProperty annotProperty = SettingHelper.GetAnnotDefaultProperty(AnnotArgsType.AnnotUnderline);
             if (annotProperty == null)
             {
                 annotProperty = new DefaultAnnotProperty();
@@ -387,7 +386,7 @@ namespace PDF_Office.ViewModels.Tools
                 stickyAnnotArgs.Color = Color.FromRgb(0xFF, 0x81, 0x33);
                 stickyAnnotArgs.StickyNote = string.Empty;
                 stickyAnnotArgs.Transparency = 1;
-                 DefaultAnnotProperty annotProperty = SettingHelper.GetAnnotDefaultProperty(AnnotArgsType.AnnotSticky);
+                DefaultAnnotProperty annotProperty = SettingHelper.GetAnnotDefaultProperty(AnnotArgsType.AnnotSticky);
                 if (annotProperty != null)
                 {
                     stickyAnnotArgs.Color = annotProperty.ForgoundColor;
@@ -407,6 +406,7 @@ namespace PDF_Office.ViewModels.Tools
             AddToPropertyPanel("StickyNoteProperty", "StickyNote", stickyAnnotArgs, annotAttribsList);
             return stickyAnnotArgs;
         }
+
         private AnnotHandlerEventArgs GetRect(SquareAnnotArgs selectedsquareArgs = null)
         {
             Dictionary<AnnotAttrib, object> annotAttribsList = new Dictionary<AnnotAttrib, object>();
@@ -618,22 +618,25 @@ namespace PDF_Office.ViewModels.Tools
         private AnnotHandlerEventArgs GetSnapshotEdit(CustomIconToggleBtn annotBtn)
         {
             SnapshotEditToolArgs snapshotArgs = new SnapshotEditToolArgs();
-
+            //SnapshotEditMenuViewModel snapshotEditMenuViewModel = new SnapshotEditMenuViewModel();
             snapshotArgs.ControlPointColor = Colors.White;
             snapshotArgs.BgColor = Color.FromArgb(0x99, 0x00, 0x00, 0x00);
             snapshotArgs.LineColor = Color.FromArgb(0xFF, 0x47, 0x7E, 0xDE);
-            SnapshotEditMenuViewModel.SnapToolArgs = snapshotArgs;
-            SnapshotEditMenuViewModel.PDFViewer = PDFViewer;
-            SnapshotEditMenuViewModel.SnapToolEvent += SnapshotEditMenuViewModel_SnapToolEvent; ;
-
-            #region to do
 
             //SnapshotEditMenu snapMenu = new SnapshotEditMenu();
             //snapshotArgs.ToolPanel = snapMenu;
             //SnapshotEditMenuViewModel snapshotEditMenuViewModel = (SnapshotEditMenuViewModel)snapMenu.DataContext;
             //snapshotEditMenuViewModel.SnapToolArgs = snapshotArgs;
-            //snapshotEditMenuViewModel.PdfViewer = PDFViewer;
+            //snapshotEditMenuViewModel.PDFViewer = PDFViewer;
             //snapshotEditMenuViewModel.ToggleBtn = annotBtn;
+            //snapshotEditMenuViewModel.SnapToolEvent += SnapshotEditMenuViewModel_SnapToolEvent;
+            //SnapshotEditMenuViewModel = snapshotEditMenuViewModel;
+
+            #region to do
+
+            SnapshotEditMenuViewModel.SnapToolArgs = snapshotArgs;
+            SnapshotEditMenuViewModel.PDFViewer = PDFViewer;
+            SnapshotEditMenuViewModel.SnapToolEvent += SnapshotEditMenuViewModel_SnapToolEvent;
 
             #endregion to do
 

+ 4 - 1
PDF Office/ViewModels/ViewContentViewModel.cs

@@ -511,9 +511,10 @@ namespace PDF_Office.ViewModels
             catch
             {
                 AlertsMessage alertsMessage = new AlertsMessage();
-                alertsMessage.ShowDialog("","未检测到Ooutlook软件,请先安装Outlook","OK");
+                alertsMessage.ShowDialog("", "未检测到Ooutlook软件,请先安装Outlook", "OK");
             }
         }
+
         private void SettingsEvent()
         {
             new InfoDialog().ShowDialog();
@@ -710,6 +711,7 @@ namespace PDF_Office.ViewModels
         /// <param name="viewContent"></param>
         public async void RbtnReadMode(ViewContent viewContent)
         {
+            App.mainWindowViewModel.SelectedItem.IsInReadctonMode = true;
             App.IsBookMode = true;
             IsLoading = Visibility.Visible;
             await Task.Delay(1);
@@ -738,6 +740,7 @@ namespace PDF_Office.ViewModels
         /// </summary>
         public async void UnReadModel()
         {
+            App.mainWindowViewModel.SelectedItem.IsInReadctonMode = false;
             App.IsBookMode = false;
             IsLoading = Visibility.Visible;
             await Task.Delay(1);