FRPaintEventArgs.cs 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Text;
  4. using System.Drawing;
  5. namespace FastReport.Utils
  6. {
  7. /// <summary>
  8. /// Provides a data for paint event.
  9. /// </summary>
  10. public class FRPaintEventArgs
  11. {
  12. private IGraphics graphics;
  13. private float scaleX;
  14. private float scaleY;
  15. private GraphicCache cache;
  16. /// <summary>
  17. /// Gets a <b>Graphics</b> object to draw on.
  18. /// </summary>
  19. public IGraphics Graphics
  20. {
  21. get { return graphics; }
  22. }
  23. /// <summary>
  24. /// Gets the X scale factor.
  25. /// </summary>
  26. public float ScaleX
  27. {
  28. get { return scaleX; }
  29. }
  30. /// <summary>
  31. /// Gets the Y scale factor.
  32. /// </summary>
  33. public float ScaleY
  34. {
  35. get { return scaleY; }
  36. }
  37. /// <summary>
  38. /// Gets the cache that contains graphics objects.
  39. /// </summary>
  40. public GraphicCache Cache
  41. {
  42. get { return cache; }
  43. }
  44. /// <summary>
  45. /// Initializes a new instance of the <b>FRPaintEventArgs</b> class with specified settings.
  46. /// </summary>
  47. /// <param name="g"><b>IGraphicsRenderer</b> object to draw on.</param>
  48. /// <param name="scaleX">X scale factor.</param>
  49. /// <param name="scaleY">Y scale factor.</param>
  50. /// <param name="cache">Cache that contains graphics objects.</param>
  51. public FRPaintEventArgs(IGraphics g, float scaleX, float scaleY, GraphicCache cache)
  52. {
  53. graphics = g;
  54. this.scaleX = scaleX;
  55. this.scaleY = scaleY;
  56. this.cache = cache;
  57. }
  58. /// <summary>
  59. /// Initializes a new instance of the <b>FRPaintEventArgs</b> class with specified settings.
  60. /// </summary>
  61. /// <param name="g"><b>Graphics</b> object to draw on.</param>
  62. /// <param name="scaleX">X scale factor.</param>
  63. /// <param name="scaleY">Y scale factor.</param>
  64. /// <param name="cache">Cache that contains graphics objects.</param>
  65. public FRPaintEventArgs(Graphics g, float scaleX, float scaleY, GraphicCache cache) :
  66. this(GdiGraphics.FromGraphics(g), scaleX, scaleY, cache)
  67. {
  68. }
  69. }
  70. }