|
@@ -1,6 +1,7 @@
|
|
using ComPDFKit.Measure;
|
|
using ComPDFKit.Measure;
|
|
using ComPDFKit.PDFAnnotation;
|
|
using ComPDFKit.PDFAnnotation;
|
|
using ComPDFKit.PDFAnnotation.Form;
|
|
using ComPDFKit.PDFAnnotation.Form;
|
|
|
|
+using ComPDFKit.Tool;
|
|
using Compdfkit_Tools.Helper;
|
|
using Compdfkit_Tools.Helper;
|
|
using Compdfkit_Tools.Measure;
|
|
using Compdfkit_Tools.Measure;
|
|
using Compdfkit_Tools.Measure.Property;
|
|
using Compdfkit_Tools.Measure.Property;
|
|
@@ -206,7 +207,7 @@ namespace Compdfkit_Tools.PDFControl
|
|
|
|
|
|
private void MeasureBtn_Click(object sender, RoutedEventArgs e)
|
|
private void MeasureBtn_Click(object sender, RoutedEventArgs e)
|
|
{
|
|
{
|
|
- //AnnotHandlerEventArgs args = null;
|
|
|
|
|
|
+ AnnotParam annotParam = null;
|
|
ClearToolState(sender as ToggleButton);
|
|
ClearToolState(sender as ToggleButton);
|
|
if ((bool)(sender as ToggleButton).IsChecked)
|
|
if ((bool)(sender as ToggleButton).IsChecked)
|
|
{
|
|
{
|
|
@@ -215,7 +216,7 @@ namespace Compdfkit_Tools.PDFControl
|
|
case MeasureType.UnKnown:
|
|
case MeasureType.UnKnown:
|
|
break;
|
|
break;
|
|
case MeasureType.Line:
|
|
case MeasureType.Line:
|
|
- //args = CreateLine();
|
|
|
|
|
|
+ annotParam = CreateLine();
|
|
break;
|
|
break;
|
|
case MeasureType.Multiline:
|
|
case MeasureType.Multiline:
|
|
//args = CreateMultiline();
|
|
//args = CreateMultiline();
|
|
@@ -235,41 +236,45 @@ namespace Compdfkit_Tools.PDFControl
|
|
//pdfViewer.SetMouseMode(MouseModes.PanTool);
|
|
//pdfViewer.SetMouseMode(MouseModes.PanTool);
|
|
measureControl.SetInfoPanelVisble(false, false);
|
|
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
|
|
#endregion
|
|
|
|
|
|
//#region Create Form
|
|
//#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()
|
|
//private AnnotHandlerEventArgs CreateMultiline()
|
|
//{
|
|
//{
|