SquigglyParam.cs 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. using ComPDFKit.Import;
  2. using ComPDFKit.PDFAnnotation;
  3. using System.Collections.Generic;
  4. namespace ComPDFKit.Tool
  5. {
  6. public class SquigglyParam:AnnotParam
  7. {
  8. public SquigglyParam ()
  9. {
  10. CurrentType = C_ANNOTATION_TYPE.C_ANNOTATION_SQUIGGLY;
  11. }
  12. public byte[] SquigglyColor { get; set; } = new byte[3] { 255, 0, 0 };
  13. public List<CRect> QuardRects { get; set; }
  14. public override bool CopyTo(AnnotParam transfer)
  15. {
  16. SquigglyParam squigglyTransfer = transfer as SquigglyParam;
  17. if (squigglyTransfer == null)
  18. {
  19. return false;
  20. }
  21. if (!base.CopyTo(squigglyTransfer))
  22. {
  23. return false;
  24. }
  25. squigglyTransfer.SquigglyColor = SquigglyColor;
  26. if(SquigglyColor!=null)
  27. {
  28. squigglyTransfer.SquigglyColor= (byte[])SquigglyColor.Clone();
  29. }
  30. if (QuardRects != null)
  31. {
  32. List<CRect> rectList = new List<CRect>();
  33. foreach (CRect saveRect in QuardRects)
  34. {
  35. rectList.Add(saveRect);
  36. }
  37. squigglyTransfer.QuardRects = rectList;
  38. }
  39. return true;
  40. }
  41. }
  42. }