BmpFileType.cs 793 B

1234567891011121314151617181920212223242526272829303132333435
  1. using System.Drawing;
  2. using System.IO;
  3. namespace PaintDotNet
  4. {
  5. public sealed class BmpFileType : FileType
  6. {
  7. public BmpFileType()
  8. : base("BMP", FileTypeFlags.SupportsLoading | FileTypeFlags.SupportsSaving, new string[] { ".bmp" })
  9. {
  10. }
  11. public enum PropertyNames
  12. {
  13. BitDepth = 0,
  14. DitherLevel = 1
  15. }
  16. public enum BmpBitDepthUIChoices
  17. {
  18. AutoDetect = 0,
  19. Bpp24 = 1,
  20. Bpp8 = 2
  21. }
  22. public override Document OnLoad(Stream input)
  23. {
  24. using (Image image = PdnResources.LoadImage(input))
  25. {
  26. Document document = Document.FromImage(image);
  27. return document;
  28. }
  29. }
  30. }
  31. }