|
@@ -1,6 +1,7 @@
|
|
|
using ComPDFKit.Measure;
|
|
|
using ComPDFKit.PDFAnnotation;
|
|
|
using ComPDFKit.PDFAnnotation.Form;
|
|
|
+using ComPDFKit.Tool;
|
|
|
using Compdfkit_Tools.Helper;
|
|
|
using Compdfkit_Tools.Measure;
|
|
|
using Compdfkit_Tools.Measure.Property;
|
|
@@ -206,7 +207,7 @@ namespace Compdfkit_Tools.PDFControl
|
|
|
|
|
|
private void MeasureBtn_Click(object sender, RoutedEventArgs e)
|
|
|
{
|
|
|
- //AnnotHandlerEventArgs args = null;
|
|
|
+ AnnotParam annotParam = null;
|
|
|
ClearToolState(sender as ToggleButton);
|
|
|
if ((bool)(sender as ToggleButton).IsChecked)
|
|
|
{
|
|
@@ -215,7 +216,7 @@ namespace Compdfkit_Tools.PDFControl
|
|
|
case MeasureType.UnKnown:
|
|
|
break;
|
|
|
case MeasureType.Line:
|
|
|
- //args = CreateLine();
|
|
|
+ annotParam = CreateLine();
|
|
|
break;
|
|
|
case MeasureType.Multiline:
|
|
|
//args = CreateMultiline();
|
|
@@ -235,41 +236,45 @@ namespace Compdfkit_Tools.PDFControl
|
|
|
//pdfViewer.SetMouseMode(MouseModes.PanTool);
|
|
|
measureControl.SetInfoPanelVisble(false, false);
|
|
|
}
|
|
|
- //if (args != null)
|
|
|
- //{
|
|
|
- // panelState.RightPanel = RightPanelState.PropertyPanel;
|
|
|
- //}
|
|
|
- //measurePropertyControl.SetPropertyForMeasureCreate(args,null);
|
|
|
+ if (annotParam != null)
|
|
|
+ {
|
|
|
+ panelState.RightPanel = RightPanelState.PropertyPanel;
|
|
|
+ }
|
|
|
+ measurePropertyControl.SetPropertyForMeasureCreate(annotParam);
|
|
|
}
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
//#region Create Form
|
|
|
|
|
|
- //private AnnotHandlerEventArgs CreateLine()
|
|
|
- //{
|
|
|
- // LineMeasureArgs lineMeasureArgs = new LineMeasureArgs();
|
|
|
- // lineMeasureArgs.LineColor = Colors.Red;
|
|
|
- // lineMeasureArgs.LineWidth = 2;
|
|
|
- // lineMeasureArgs.Transparency = 1;
|
|
|
- // lineMeasureArgs.FontColor = Colors.Red;
|
|
|
- // lineMeasureArgs.FontName = "Arial";
|
|
|
- // lineMeasureArgs.FontSize = 14;
|
|
|
- // lineMeasureArgs.HeadLineType = C_LINE_TYPE.LINETYPE_ARROW;
|
|
|
- // lineMeasureArgs.TailLineType = C_LINE_TYPE.LINETYPE_ARROW;
|
|
|
- // pdfViewer?.ClearSelectAnnots();
|
|
|
- // pdfViewer?.SetMouseMode(MouseModes.AnnotCreate);
|
|
|
- // pdfViewer?.SetToolParam(lineMeasureArgs);
|
|
|
- // measureControl.SetMeasureInfoType(CPDFMeasureType.CPDF_DISTANCE_MEASURE);
|
|
|
- // measureControl.SetInfoPanelVisble(true, false);
|
|
|
- // measureControl.SetMeasureScale(CPDFMeasureType.CPDF_DISTANCE_MEASURE,
|
|
|
- // string.Format("{0}{1}={2}{3}",
|
|
|
- // MeasureSetting.RulerBase,
|
|
|
- // MeasureSetting.RulerBaseUnit,
|
|
|
- // MeasureSetting.RulerTranslate,
|
|
|
- // MeasureSetting.RulerTranslateUnit));
|
|
|
- // return lineMeasureArgs;
|
|
|
- //}
|
|
|
+ private AnnotParam CreateLine()
|
|
|
+ {
|
|
|
+ pdfViewer.SetToolType(CPDFToolManager.ToolType.CreateAnnot);
|
|
|
+ pdfViewer.SetCreateAnnotType(C_ANNOTATION_TYPE.C_ANNOTATION_LINE);
|
|
|
+ LineMeasureParam textBoxParam = new LineMeasureParam();
|
|
|
+ textBoxParam.CurrentType = C_ANNOTATION_TYPE.C_ANNOTATION_LINE;
|
|
|
+ textBoxParam.LineColor = new byte[] { 255, 0, 0, };
|
|
|
+ textBoxParam.LineWidth = 2;
|
|
|
+ textBoxParam.Transparency = 1;
|
|
|
+ textBoxParam.FontColor = new byte[] { 255, 0, 0, };
|
|
|
+ textBoxParam.FontName = "Arial";
|
|
|
+ textBoxParam.FontSize = 14;
|
|
|
+ textBoxParam.HeadLineType = C_LINE_TYPE.LINETYPE_ARROW;
|
|
|
+ textBoxParam.TailLineType = C_LINE_TYPE.LINETYPE_ARROW;
|
|
|
+ pdfViewer.SetAnnotParam(textBoxParam);
|
|
|
+ //pdfViewer?.ClearSelectAnnots();
|
|
|
+ //pdfViewer?.SetMouseMode(MouseModes.AnnotCreate);
|
|
|
+ //pdfViewer?.SetToolParam(lineMeasureArgs);
|
|
|
+ //measureControl.SetMeasureInfoType(CPDFMeasureType.CPDF_DISTANCE_MEASURE);
|
|
|
+ //measureControl.SetInfoPanelVisble(true, false);
|
|
|
+ //measureControl.SetMeasureScale(CPDFMeasureType.CPDF_DISTANCE_MEASURE,
|
|
|
+ // string.Format("{0}{1}={2}{3}",
|
|
|
+ // MeasureSetting.RulerBase,
|
|
|
+ // MeasureSetting.RulerBaseUnit,
|
|
|
+ // MeasureSetting.RulerTranslate,
|
|
|
+ // MeasureSetting.RulerTranslateUnit));
|
|
|
+ return textBoxParam;
|
|
|
+ }
|
|
|
|
|
|
//private AnnotHandlerEventArgs CreateMultiline()
|
|
|
//{
|