Layer.cs 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. using PixiEditor.Helpers;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.ComponentModel;
  5. using System.Diagnostics;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Threading.Tasks;
  9. using System.Windows;
  10. using System.Windows.Controls;
  11. using System.Windows.Media;
  12. using System.Windows.Media.Imaging;
  13. namespace PixiEditor.Models
  14. {
  15. public class Layer : BasicLayer
  16. {
  17. private WriteableBitmap _layerBitmap;
  18. public WriteableBitmap LayerBitmap
  19. {
  20. get { return _layerBitmap; }
  21. set {
  22. _layerBitmap = value;
  23. RaisePropertyChanged("LayerBitmap");
  24. }
  25. }
  26. public Layer(int width, int height)
  27. {
  28. Layer layer = LayerGenerator.Generate(width, height);
  29. LayerBitmap = layer.LayerBitmap;
  30. Width = width;
  31. Height = height;
  32. }
  33. public Layer(WriteableBitmap layerBitmap)
  34. {
  35. LayerBitmap = layerBitmap;
  36. Width = (int) layerBitmap.Width;
  37. Height = (int) layerBitmap.Height;
  38. }
  39. }
  40. }