|
@@ -795,84 +795,81 @@ namespace ComPDFKit.Tool
|
|
private void DefaultPolygonMeasureAnnot(CPDFAnnotation cPDFAnnotation, AnnotParam annotParam)
|
|
private void DefaultPolygonMeasureAnnot(CPDFAnnotation cPDFAnnotation, AnnotParam annotParam)
|
|
{
|
|
{
|
|
CPDFPolygonAnnotation PolyAnnotation = (cPDFAnnotation as CPDFPolygonAnnotation);
|
|
CPDFPolygonAnnotation PolyAnnotation = (cPDFAnnotation as CPDFPolygonAnnotation);
|
|
-
|
|
|
|
bool IsOpenMeasure = true;
|
|
bool IsOpenMeasure = true;
|
|
-
|
|
|
|
if (PolyAnnotation == null)
|
|
if (PolyAnnotation == null)
|
|
{
|
|
{
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
- if (annotParam != null)
|
|
|
|
- {
|
|
|
|
- return;
|
|
|
|
- }
|
|
|
|
|
|
|
|
- PolygonMeasureParam MeasureParam;
|
|
|
|
|
|
+ PolygonMeasureParam polyonMeasureParam;
|
|
if (annotParam == null)
|
|
if (annotParam == null)
|
|
{
|
|
{
|
|
DefaultSettingParam defaultSettingParam = GetDefaultSettingParam();
|
|
DefaultSettingParam defaultSettingParam = GetDefaultSettingParam();
|
|
- MeasureParam = defaultSettingParam.PolygonMeasureParamDef;
|
|
|
|
|
|
+ polyonMeasureParam = defaultSettingParam.PolygonMeasureParamDef;
|
|
IsOpenMeasure = defaultSettingParam.IsOpenMeasure;
|
|
IsOpenMeasure = defaultSettingParam.IsOpenMeasure;
|
|
}
|
|
}
|
|
else
|
|
else
|
|
{
|
|
{
|
|
- MeasureParam = annotParam as PolygonMeasureParam;
|
|
|
|
|
|
+ polyonMeasureParam = annotParam as PolygonMeasureParam;
|
|
IsOpenMeasure = defaultSettingParam.IsOpenMeasure;
|
|
IsOpenMeasure = defaultSettingParam.IsOpenMeasure;
|
|
}
|
|
}
|
|
|
|
|
|
- if (MeasureParam.LineColor != null)
|
|
|
|
|
|
+ if (polyonMeasureParam.LineColor != null)
|
|
{
|
|
{
|
|
- PolyAnnotation.SetLineColor(MeasureParam.LineColor);
|
|
|
|
|
|
+ PolyAnnotation.SetLineColor(polyonMeasureParam.LineColor);
|
|
}
|
|
}
|
|
- PolyAnnotation.SetLineWidth((float)MeasureParam.LineWidth);
|
|
|
|
|
|
|
|
- if (MeasureParam.LineDash != null)
|
|
|
|
|
|
+ PolyAnnotation.SetLineWidth((float)polyonMeasureParam.LineWidth);
|
|
|
|
+ if (polyonMeasureParam.LineDash != null)
|
|
{
|
|
{
|
|
- if (MeasureParam.LineDash.Length == 0)
|
|
|
|
|
|
+ if (polyonMeasureParam.LineDash.Length == 0)
|
|
{
|
|
{
|
|
PolyAnnotation.SetBorderStyle(C_BORDER_STYLE.BS_SOLID, new float[0]);
|
|
PolyAnnotation.SetBorderStyle(C_BORDER_STYLE.BS_SOLID, new float[0]);
|
|
}
|
|
}
|
|
else
|
|
else
|
|
{
|
|
{
|
|
- PolyAnnotation.SetBorderStyle(C_BORDER_STYLE.BS_DASHDED, MeasureParam.LineDash);
|
|
|
|
|
|
+ PolyAnnotation.SetBorderStyle(C_BORDER_STYLE.BS_DASHDED, polyonMeasureParam.LineDash);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- if (MeasureParam.HasFillColor && MeasureParam.FillColor != null && MeasureParam.FillColor.Length == 3)
|
|
|
|
|
|
+ if (polyonMeasureParam.HasFillColor && polyonMeasureParam.FillColor != null && polyonMeasureParam.FillColor.Length == 3)
|
|
|
|
+ {
|
|
|
|
+ PolyAnnotation.SetBgColor(polyonMeasureParam.FillColor);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if(polyonMeasureParam.BorderEffector != null)
|
|
{
|
|
{
|
|
- PolyAnnotation.SetBgColor(MeasureParam.FillColor);
|
|
|
|
|
|
+ PolyAnnotation.SetAnnotBorderEffector(polyonMeasureParam.BorderEffector);
|
|
}
|
|
}
|
|
|
|
|
|
- if(MeasureParam.BorderEffector != null)
|
|
|
|
|
|
+ if (polyonMeasureParam.SavePoints != null && polyonMeasureParam.SavePoints.Count>0)
|
|
{
|
|
{
|
|
- PolyAnnotation.SetAnnotBorderEffector(MeasureParam.BorderEffector);
|
|
|
|
|
|
+ PolyAnnotation.SetPoints(polyonMeasureParam.SavePoints);
|
|
}
|
|
}
|
|
|
|
|
|
if (IsOpenMeasure)
|
|
if (IsOpenMeasure)
|
|
{
|
|
{
|
|
CTextAttribute textAttribute = new CTextAttribute();
|
|
CTextAttribute textAttribute = new CTextAttribute();
|
|
- textAttribute.FontColor = MeasureParam.FontColor;
|
|
|
|
- textAttribute.FontSize = (float)MeasureParam.FontSize;
|
|
|
|
- textAttribute.FontName = CFontNameHelper.ObtainFontName(CFontNameHelper.GetFontType(MeasureParam.FontName),
|
|
|
|
- MeasureParam.IsBold,
|
|
|
|
- MeasureParam.IsItalic);
|
|
|
|
|
|
+ textAttribute.FontColor = polyonMeasureParam.FontColor;
|
|
|
|
+ textAttribute.FontSize = (float)polyonMeasureParam.FontSize;
|
|
|
|
+ textAttribute.FontName = CFontNameHelper.ObtainFontName(CFontNameHelper.GetFontType(polyonMeasureParam.FontName),
|
|
|
|
+ polyonMeasureParam.IsBold,
|
|
|
|
+ polyonMeasureParam.IsItalic);
|
|
PolyAnnotation.SetTextAttribute(textAttribute);
|
|
PolyAnnotation.SetTextAttribute(textAttribute);
|
|
- if (MeasureParam.measureInfo != null)
|
|
|
|
|
|
+ if (polyonMeasureParam.measureInfo != null)
|
|
{
|
|
{
|
|
CPDFAreaMeasure polygonMeasure = PolyAnnotation.GetAreaMeasure();
|
|
CPDFAreaMeasure polygonMeasure = PolyAnnotation.GetAreaMeasure();
|
|
if (polygonMeasure != null)
|
|
if (polygonMeasure != null)
|
|
{
|
|
{
|
|
- polygonMeasure.SetMeasureInfo(MeasureParam.measureInfo);
|
|
|
|
- polygonMeasure.SetMeasureScale(MeasureParam.measureInfo.RulerBase, MeasureParam.measureInfo.RulerBaseUnit,
|
|
|
|
- MeasureParam.measureInfo.RulerTranslate, MeasureParam.measureInfo.RulerTranslateUnit);
|
|
|
|
|
|
+ polygonMeasure.SetMeasureInfo(polyonMeasureParam.measureInfo);
|
|
|
|
+ polygonMeasure.SetMeasureScale(polyonMeasureParam.measureInfo.RulerBase, polyonMeasureParam.measureInfo.RulerBaseUnit,
|
|
|
|
+ polyonMeasureParam.measureInfo.RulerTranslate, polyonMeasureParam.measureInfo.RulerTranslateUnit);
|
|
polygonMeasure.UpdateAnnotMeasure();
|
|
polygonMeasure.UpdateAnnotMeasure();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- cPDFAnnotation.UpdateAp();
|
|
|
|
}
|
|
}
|
|
|
|
|
|
-
|
|
|
|
- DefaultAnnot(cPDFAnnotation, MeasureParam);
|
|
|
|
|
|
+ DefaultAnnot(cPDFAnnotation, polyonMeasureParam);
|
|
}
|
|
}
|
|
|
|
|
|
private void DefaultPolyLineMeasureAnnot(CPDFAnnotation cPDFAnnotation, AnnotParam annotParam)
|
|
private void DefaultPolyLineMeasureAnnot(CPDFAnnotation cPDFAnnotation, AnnotParam annotParam)
|