Solid.cs 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. using FastReport.Export.Dxf.Utils;
  2. using System.Drawing;
  3. namespace FastReport.Export.Dxf.Sections.Entities
  4. {
  5. internal class Solid : EntityBase
  6. {
  7. #region Private Fields
  8. private Color color;
  9. private float height;
  10. private float width;
  11. private float x;
  12. private float y;
  13. #endregion Private Fields
  14. #region Public Constructors
  15. public Solid(float x, float y, float width, float height, Color color) : base()
  16. {
  17. this.x = x;
  18. this.y = y;
  19. this.width = width;
  20. this.height = height;
  21. this.color = color;
  22. InitGroups();
  23. }
  24. #endregion Public Constructors
  25. #region Private Methods
  26. private void InitGroups()
  27. {
  28. // 0
  29. // SOLID
  30. // 8
  31. // barcode
  32. // 62
  33. // 18
  34. // 10
  35. // 1
  36. // 20
  37. // 2
  38. // 30
  39. // 0
  40. // 11
  41. // 2
  42. // 21
  43. // 2
  44. // 31
  45. // 0
  46. // 12
  47. // 1
  48. // 22
  49. // 1
  50. // 32
  51. // 0
  52. // 13
  53. // 2
  54. // 23
  55. // 1
  56. // 33
  57. // 0
  58. AddTypeName("SOLID");
  59. AddGroup(8, "Layer_1");
  60. byte aciColor = ACIDictionary.GetAciColor(color);
  61. AddColor(aciColor);
  62. AddPrimary2DPoint(x, y);
  63. AddSecondPoint(x + width, y);
  64. AddThirdPoint(x, y - height);
  65. AddFourthPoint(x + width, y - height);
  66. }
  67. #endregion Private Methods
  68. }
  69. }