|
@@ -795,84 +795,81 @@ namespace ComPDFKit.Tool
|
|
|
private void DefaultPolygonMeasureAnnot(CPDFAnnotation cPDFAnnotation, AnnotParam annotParam)
|
|
|
{
|
|
|
CPDFPolygonAnnotation PolyAnnotation = (cPDFAnnotation as CPDFPolygonAnnotation);
|
|
|
-
|
|
|
bool IsOpenMeasure = true;
|
|
|
-
|
|
|
if (PolyAnnotation == null)
|
|
|
{
|
|
|
return;
|
|
|
}
|
|
|
- if (annotParam != null)
|
|
|
- {
|
|
|
- return;
|
|
|
- }
|
|
|
|
|
|
- PolygonMeasureParam MeasureParam;
|
|
|
+ PolygonMeasureParam polyonMeasureParam;
|
|
|
if (annotParam == null)
|
|
|
{
|
|
|
DefaultSettingParam defaultSettingParam = GetDefaultSettingParam();
|
|
|
- MeasureParam = defaultSettingParam.PolygonMeasureParamDef;
|
|
|
+ polyonMeasureParam = defaultSettingParam.PolygonMeasureParamDef;
|
|
|
IsOpenMeasure = defaultSettingParam.IsOpenMeasure;
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- MeasureParam = annotParam as PolygonMeasureParam;
|
|
|
+ polyonMeasureParam = annotParam as PolygonMeasureParam;
|
|
|
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]);
|
|
|
}
|
|
|
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)
|
|
|
{
|
|
|
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);
|
|
|
- if (MeasureParam.measureInfo != null)
|
|
|
+ if (polyonMeasureParam.measureInfo != null)
|
|
|
{
|
|
|
CPDFAreaMeasure polygonMeasure = PolyAnnotation.GetAreaMeasure();
|
|
|
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();
|
|
|
}
|
|
|
}
|
|
|
- cPDFAnnotation.UpdateAp();
|
|
|
}
|
|
|
|
|
|
-
|
|
|
- DefaultAnnot(cPDFAnnotation, MeasureParam);
|
|
|
+ DefaultAnnot(cPDFAnnotation, polyonMeasureParam);
|
|
|
}
|
|
|
|
|
|
private void DefaultPolyLineMeasureAnnot(CPDFAnnotation cPDFAnnotation, AnnotParam annotParam)
|