Parcourir la source

其他 - Form的AP更新,与注释的类型调整

zhuyi il y a 1 an
Parent
commit
a828a753bf

+ 10 - 10
Demo/Examples/Compdfkit_Tools/Annotation/PDFAnnotationPanel/PDFAnnotationControl/CPDFAnnotationControl.xaml.cs

@@ -220,7 +220,7 @@ namespace Compdfkit_Tools.PDFControl
 
                         byte[] Color = new byte[] { highlightData.Color.R, highlightData.Color.G, highlightData.Color.B };
                         (annotHandlerEventArgs as HighlightParam).HighlightColor = Color;
-                        (annotHandlerEventArgs as HighlightParam).Transparency = (int)(highlightData.Opacity * 255);
+                        (annotHandlerEventArgs as HighlightParam).Transparency = Convert.ToByte(highlightData.Opacity * 255);
                         (annotHandlerEventArgs as HighlightParam).Content = highlightData.Note;
                         (annotHandlerEventArgs as HighlightParam).Author = highlightData.Author;
                         (annotHandlerEventArgs as HighlightParam).Locked = highlightData.IsLocked;
@@ -234,7 +234,7 @@ namespace Compdfkit_Tools.PDFControl
                         annotHandlerEventArgs = new UnderlineParam();
                         byte[] Color = new byte[] { underlineData.Color.R, underlineData.Color.G, underlineData.Color.B };
                         (annotHandlerEventArgs as UnderlineParam).UnderlineColor = Color;
-                        (annotHandlerEventArgs as UnderlineParam).Transparency = (int)(underlineData.Opacity * 255);
+                        (annotHandlerEventArgs as UnderlineParam).Transparency = Convert.ToByte(underlineData.Opacity * 255);
                         (annotHandlerEventArgs as UnderlineParam).Author = underlineData.Author;
                         (annotHandlerEventArgs as UnderlineParam).Content = underlineData.Note;
                         (annotHandlerEventArgs as UnderlineParam).Locked = underlineData.IsLocked;
@@ -248,7 +248,7 @@ namespace Compdfkit_Tools.PDFControl
                         annotHandlerEventArgs = new StrikeoutParam();
                         byte[] Color = new byte[] { strikeoutData.Color.R, strikeoutData.Color.G, strikeoutData.Color.B };
                         (annotHandlerEventArgs as StrikeoutParam).StrikeoutColor = Color;
-                        (annotHandlerEventArgs as StrikeoutParam).Transparency = (int)(strikeoutData.Opacity * 255);
+                        (annotHandlerEventArgs as StrikeoutParam).Transparency = Convert.ToByte(strikeoutData.Opacity * 255);
                         (annotHandlerEventArgs as StrikeoutParam).Locked = strikeoutData.IsLocked;
                         (annotHandlerEventArgs as StrikeoutParam).Author = strikeoutData.Author;
                         (annotHandlerEventArgs as StrikeoutParam).Content = strikeoutData.Note;
@@ -262,7 +262,7 @@ namespace Compdfkit_Tools.PDFControl
                         annotHandlerEventArgs = new SquigglyParam();
                         byte[] Color = new byte[] { squigglyData.Color.R, squigglyData.Color.G, squigglyData.Color.B };
                         (annotHandlerEventArgs as SquigglyParam).SquigglyColor = Color;
-                        (annotHandlerEventArgs as SquigglyParam).Transparency = (int)(squigglyData.Opacity * 255);
+                        (annotHandlerEventArgs as SquigglyParam).Transparency = Convert.ToByte(squigglyData.Opacity * 255);
                         (annotHandlerEventArgs as SquigglyParam).Locked = squigglyData.IsLocked;
                         (annotHandlerEventArgs as SquigglyParam).Author = squigglyData.Author;
                         (annotHandlerEventArgs as SquigglyParam).Content = squigglyData.Note;
@@ -279,7 +279,7 @@ namespace Compdfkit_Tools.PDFControl
                         byte[] FillColor = new byte[] { squareData.FillColor.R, squareData.FillColor.G, squareData.FillColor.B };
                         (annotHandlerEventArgs as SquareParam).BgColor = FillColor;
                         (annotHandlerEventArgs as SquareParam).LineWidth = squareData.Thickness;
-                        (annotHandlerEventArgs as SquareParam).Transparency = (int)(squareData.Opacity * 255);
+                        (annotHandlerEventArgs as SquareParam).Transparency = Convert.ToByte(squareData.Opacity * 255);
                         ParamConverter.ParseDashStyle(squareData.DashStyle, out float[] LineDash, out C_BORDER_STYLE BorderStyle);
                         (annotHandlerEventArgs as SquareParam).LineDash = LineDash;
                         (annotHandlerEventArgs as SquareParam).BorderStyle = BorderStyle;
@@ -299,7 +299,7 @@ namespace Compdfkit_Tools.PDFControl
                         byte[] BgColor = new byte[] { cicleData.FillColor.R, cicleData.FillColor.G, cicleData.FillColor.B };
                         (annotHandlerEventArgs as CircleParam).BgColor = BgColor;
                         (annotHandlerEventArgs as CircleParam).LineWidth = cicleData.Thickness;
-                        (annotHandlerEventArgs as CircleParam).Transparency = (int)(cicleData.Opacity * 255);
+                        (annotHandlerEventArgs as CircleParam).Transparency = Convert.ToByte(cicleData.Opacity * 255);
                         ParamConverter.ParseDashStyle(cicleData.DashStyle, out float[] LineDash, out C_BORDER_STYLE BorderStyle);
                         (annotHandlerEventArgs as CircleParam).LineDash = LineDash;
                         (annotHandlerEventArgs as CircleParam).BorderStyle = BorderStyle;
@@ -318,7 +318,7 @@ namespace Compdfkit_Tools.PDFControl
                         byte[] LineColor = new byte[] { lineData.BorderColor.R, lineData.BorderColor.G, lineData.BorderColor.B };
                         (annotHandlerEventArgs as LineParam).LineColor = LineColor;
                         (annotHandlerEventArgs as LineParam).LineWidth = lineData.Thickness;
-                        (annotHandlerEventArgs as LineParam).Transparency = (int)(lineData.Opacity * 255);
+                        (annotHandlerEventArgs as LineParam).Transparency = Convert.ToByte(lineData.Opacity * 255);
                         ParamConverter.ParseDashStyle(lineData.DashStyle, out float[] LineDash, out C_BORDER_STYLE BorderStyle);
                         (annotHandlerEventArgs as LineParam).LineDash = LineDash;
                         (annotHandlerEventArgs as LineParam).BorderStyle = BorderStyle;
@@ -350,7 +350,7 @@ namespace Compdfkit_Tools.PDFControl
                         byte[] LineColor = new byte[] { freehandData.BorderColor.R, freehandData.BorderColor.G, freehandData.BorderColor.B };
                         (annotHandlerEventArgs as InkParam).InkColor = LineColor;
                         (annotHandlerEventArgs as InkParam).Thickness = freehandData.Thickness;
-                        (annotHandlerEventArgs as InkParam).Transparency = (int)(freehandData.Opacity * 255);
+                        (annotHandlerEventArgs as InkParam).Transparency = Convert.ToByte(freehandData.Opacity * 255);
                         (annotHandlerEventArgs as InkParam).Content = freehandData.Note;
                         (annotHandlerEventArgs as InkParam).Author = freehandData.Author;
                         pdfViewerControl.PDFToolManager.SetCreateAnnotType(C_ANNOTATION_TYPE.C_ANNOTATION_INK);
@@ -361,7 +361,7 @@ namespace Compdfkit_Tools.PDFControl
                     {
                         CPDFFreeTextData freeTextData = pdfAnnotationData as CPDFFreeTextData;
                         annotHandlerEventArgs = new FreeTextParam();
-                        (annotHandlerEventArgs as FreeTextParam).Transparency = (int)(freeTextData.Opacity * 255);
+                        (annotHandlerEventArgs as FreeTextParam).Transparency = Convert.ToByte(freeTextData.Opacity * 255);
                         (annotHandlerEventArgs as FreeTextParam).FontName = freeTextData.FontFamily.ToString();
 
                         byte[] FontColor = new byte[] { freeTextData.BorderColor.R, freeTextData.BorderColor.G, freeTextData.BorderColor.B };
@@ -516,7 +516,7 @@ namespace Compdfkit_Tools.PDFControl
         {
             stampParam.StampText = stamp.StampText;
             stampParam.Author = stamp.Author;
-            stampParam.Transparency = (int)(stamp.Opacity * 255);
+            stampParam.Transparency = Convert.ToByte(stamp.Opacity * 255);
             stampParam.DateText = stamp.StampTextDate;
             stampParam.TextStampColor = stamp.TextColor;
             stampParam.TextStampShape = stamp.TextSharp;

+ 4 - 0
Demo/Examples/Compdfkit_Tools/Form/Property/ComboBoxProperty.xaml.cs

@@ -177,6 +177,7 @@ namespace Compdfkit_Tools.PDFControl
                 CTextAttribute cTextAttribute = cPDFAnnotation.GetTextAttribute();
                 cTextAttribute.FontColor = Color;
                 cPDFAnnotation.SetTextAttribute(cTextAttribute);
+                cPDFAnnotation.UpdateFormAp();
                 pdfViewerControl.PDFViewTool.GetCPDFViewer().UpDataAnnotFrame();
             }
         }
@@ -191,6 +192,7 @@ namespace Compdfkit_Tools.PDFControl
                 FontType fontType = GetFontType(cTextAttribute.FontName);
                 cTextAttribute.FontName = ObtainFontName(fontType, isBold, isItalic);
                 cPDFAnnotation.SetTextAttribute(cTextAttribute);
+                cPDFAnnotation.UpdateFormAp();
                 pdfViewerControl.PDFViewTool.GetCPDFViewer().UpDataAnnotFrame();
             }
         }
@@ -224,6 +226,7 @@ namespace Compdfkit_Tools.PDFControl
                 FontType fontType = GetFontType(cTextAttribute.FontName);
                 cTextAttribute.FontName = ObtainFontName(fontType, isBold, isItalic);
                 cPDFAnnotation.SetTextAttribute(cTextAttribute);
+                cPDFAnnotation.UpdateFormAp();
                 pdfViewerControl.PDFViewTool.GetCPDFViewer().UpDataAnnotFrame();
             }
         }
@@ -235,6 +238,7 @@ namespace Compdfkit_Tools.PDFControl
                 CTextAttribute cTextAttribute = cPDFAnnotation.GetTextAttribute();
                 cTextAttribute.FontSize = Convert.ToSingle((sender as ComboBox).SelectedItem);
                 cPDFAnnotation.SetTextAttribute(cTextAttribute);
+                cPDFAnnotation.UpdateFormAp();
                 pdfViewerControl.PDFViewTool.GetCPDFViewer().UpDataAnnotFrame();
             }
         }

+ 4 - 0
Demo/Examples/Compdfkit_Tools/Form/Property/ListBoxProperty.xaml.cs

@@ -180,6 +180,7 @@ namespace Compdfkit_Tools.PDFControl
                 CTextAttribute cTextAttribute = cPDFAnnotation.GetTextAttribute();
                 cTextAttribute.FontColor = Color;
                 cPDFAnnotation.SetTextAttribute(cTextAttribute);
+                cPDFAnnotation.UpdateFormAp();
                 pdfViewerControl.PDFViewTool.GetCPDFViewer().UpDataAnnotFrame();
             }
         }
@@ -194,6 +195,7 @@ namespace Compdfkit_Tools.PDFControl
                 FontType fontType = GetFontType(cTextAttribute.FontName);
                 cTextAttribute.FontName = ObtainFontName(fontType, isBold, isItalic);
                 cPDFAnnotation.SetTextAttribute(cTextAttribute);
+                cPDFAnnotation.UpdateFormAp();
                 pdfViewerControl.PDFViewTool.GetCPDFViewer().UpDataAnnotFrame();
             }
         }
@@ -227,6 +229,7 @@ namespace Compdfkit_Tools.PDFControl
                 FontType fontType = GetFontType(cTextAttribute.FontName);
                 cTextAttribute.FontName = ObtainFontName(fontType, isBold, isItalic);
                 cPDFAnnotation.SetTextAttribute(cTextAttribute);
+                cPDFAnnotation.UpdateFormAp();
                 pdfViewerControl.PDFViewTool.GetCPDFViewer().UpDataAnnotFrame();
             }
         }
@@ -238,6 +241,7 @@ namespace Compdfkit_Tools.PDFControl
                 CTextAttribute cTextAttribute = cPDFAnnotation.GetTextAttribute();
                 cTextAttribute.FontSize = Convert.ToSingle((sender as ComboBox).SelectedItem);
                 cPDFAnnotation.SetTextAttribute(cTextAttribute);
+                cPDFAnnotation.UpdateFormAp();
                 pdfViewerControl.PDFViewTool.GetCPDFViewer().UpDataAnnotFrame();
             }
         }

+ 4 - 0
Demo/Examples/Compdfkit_Tools/Form/Property/PushButtonProperty.xaml.cs

@@ -192,6 +192,7 @@ namespace Compdfkit_Tools.PDFControl
                 CTextAttribute cTextAttribute = cPDFAnnotation.GetTextAttribute();
                 cTextAttribute.FontColor = Color;
                 cPDFAnnotation.SetTextAttribute(cTextAttribute);
+                cPDFAnnotation.UpdateFormAp();
                 pdfViewerControl.PDFViewTool.GetCPDFViewer().UpDataAnnotFrame();
             }
         }
@@ -206,6 +207,7 @@ namespace Compdfkit_Tools.PDFControl
                 FontType fontType = GetFontType(cTextAttribute.FontName);
                 cTextAttribute.FontName = ObtainFontName(fontType, isBold, isItalic);
                 cPDFAnnotation.SetTextAttribute(cTextAttribute);
+                cPDFAnnotation.UpdateFormAp();
                 pdfViewerControl.PDFViewTool.GetCPDFViewer().UpDataAnnotFrame();
             }
         }
@@ -240,6 +242,7 @@ namespace Compdfkit_Tools.PDFControl
                 FontType fontType = GetFontType(cTextAttribute.FontName);
                 cTextAttribute.FontName = ObtainFontName(fontType, isBold, isItalic);
                 cPDFAnnotation.SetTextAttribute(cTextAttribute);
+                cPDFAnnotation.UpdateFormAp();
                 pdfViewerControl.PDFViewTool.GetCPDFViewer().UpDataAnnotFrame();
             }
         }
@@ -251,6 +254,7 @@ namespace Compdfkit_Tools.PDFControl
                 CTextAttribute cTextAttribute = cPDFAnnotation.GetTextAttribute();
                 cTextAttribute.FontSize = Convert.ToSingle((sender as ComboBox).SelectedItem);
                 cPDFAnnotation.SetTextAttribute(cTextAttribute);
+                cPDFAnnotation.UpdateFormAp();
                 pdfViewerControl.PDFViewTool.GetCPDFViewer().UpDataAnnotFrame();
             }
         }

+ 4 - 0
Demo/Examples/Compdfkit_Tools/Form/Property/TextFieldProperty.xaml.cs

@@ -169,6 +169,7 @@ namespace Compdfkit_Tools.PDFControl
                 CTextAttribute cTextAttribute = cPDFAnnotation.GetTextAttribute();
                 cTextAttribute.FontColor = Color;
                 cPDFAnnotation.SetTextAttribute(cTextAttribute);
+                cPDFAnnotation.UpdateFormAp();
                 pdfViewerControl.PDFViewTool.GetCPDFViewer().UpDataAnnotFrame();
             }
         }
@@ -183,6 +184,7 @@ namespace Compdfkit_Tools.PDFControl
                 FontType fontType = GetFontType(cTextAttribute.FontName);
                 cTextAttribute.FontName = ObtainFontName(fontType, isBold, isItalic);
                 cPDFAnnotation.SetTextAttribute(cTextAttribute);
+                cPDFAnnotation.UpdateFormAp();
                 pdfViewerControl.PDFViewTool.GetCPDFViewer().UpDataAnnotFrame();
             }
         }
@@ -216,6 +218,7 @@ namespace Compdfkit_Tools.PDFControl
                 FontType fontType = GetFontType(cTextAttribute.FontName);
                 cTextAttribute.FontName = ObtainFontName(fontType, isBold, isItalic);
                 cPDFAnnotation.SetTextAttribute(cTextAttribute);
+                cPDFAnnotation.UpdateFormAp();
                 pdfViewerControl.PDFViewTool.GetCPDFViewer().UpDataAnnotFrame();
             }
         }
@@ -227,6 +230,7 @@ namespace Compdfkit_Tools.PDFControl
                 CTextAttribute cTextAttribute = cPDFAnnotation.GetTextAttribute();
                 cTextAttribute.FontSize = Convert.ToSingle((sender as ComboBox).SelectedItem);
                 cPDFAnnotation.SetTextAttribute(cTextAttribute);
+                cPDFAnnotation.UpdateFormAp();
                 pdfViewerControl.PDFViewTool.GetCPDFViewer().UpDataAnnotFrame();
             }
         }