DataBackground.cs 770 B

123456789101112131415161718192021222324
  1. using ScottPlot.Drawing;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Drawing;
  5. using System.Text;
  6. namespace ScottPlot.Renderable
  7. {
  8. public class DataBackground : IRenderable
  9. {
  10. public Color Color { get; set; } = Color.White;
  11. public bool IsVisible { get; set; } = true;
  12. public void Render(PlotDimensions dims, Bitmap bmp, bool lowQuality = false)
  13. {
  14. using (var gfx = GDI.Graphics(bmp, dims, lowQuality: true, false))
  15. using (var brush = GDI.Brush(Color))
  16. {
  17. var dataRect = new RectangleF(x: dims.DataOffsetX, y: dims.DataOffsetY, width: dims.DataWidth, height: dims.DataHeight);
  18. gfx.FillRectangle(brush, dataRect);
  19. }
  20. }
  21. }
  22. }