SurfaceForClipboard.cs 642 B

1234567891011121314151617181920212223242526
  1. using System;
  2. using System.Drawing;
  3. namespace PaintDotNet.Measurement
  4. {
  5. // TODO: Eliminate poor code.
  6. /// <summary>
  7. /// Encapsulates a surface that can be copied to the clipboard.
  8. /// </summary>
  9. [Serializable]
  10. public class SurfaceForClipboard
  11. {
  12. public MaskedSurface MaskedSurface;
  13. public Rectangle Bounds;
  14. public SurfaceForClipboard(MaskedSurface maskedSurface)
  15. {
  16. using (PdnRegion region = maskedSurface.CreateRegion())
  17. {
  18. this.Bounds = region.GetBoundsInt();
  19. }
  20. this.MaskedSurface = maskedSurface;
  21. }
  22. }
  23. }