BitmapLayer.cs 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. namespace PDNWrapper
  4. {
  5. internal static class Layer
  6. {
  7. public static BitmapLayer CreateBackgroundLayer(int w, int h)
  8. {
  9. return new BitmapLayer(w, h);
  10. }
  11. }
  12. internal class BitmapLayer
  13. {
  14. int width, height;
  15. public Rectangle Bounds
  16. {
  17. get {return new Rectangle(0, 0, width, height); }
  18. }
  19. public void Dispose()
  20. {
  21. Surface.Dispose();
  22. foreach (var layer in ChildLayer)
  23. layer.Dispose();
  24. }
  25. public BitmapLayer(int w, int h)
  26. {
  27. Surface = new Surface(w, h);
  28. width = w;
  29. height = h;
  30. ChildLayer = new List<BitmapLayer>();
  31. IsGroup = false;
  32. }
  33. public int LayerID { get; set; }
  34. public bool IsGroup {get; set; }
  35. public BitmapLayer ParentLayer {get; set; }
  36. public List<BitmapLayer> ChildLayer { get; set; }
  37. public string Name { get; set; }
  38. public byte Opacity { get; set; }
  39. public bool Visible { get; set; }
  40. public LayerBlendMode BlendMode { get; set; }
  41. public Surface Surface { get; set; }
  42. }
  43. }