GifFileType.cs 711 B

123456789101112131415161718192021222324252627282930
  1. using System.Drawing;
  2. using System.IO;
  3. namespace PaintDotNet
  4. {
  5. public sealed class GifFileType
  6. : InternalFileType
  7. {
  8. public enum PropertyNames
  9. {
  10. Threshold = 0,
  11. DitherLevel = 1
  12. }
  13. public GifFileType()
  14. : base("GIF", FileTypeFlags.SupportsLoading | FileTypeFlags.SupportsSaving | FileTypeFlags.SavesWithProgress, new string[] { ".gif" })
  15. {
  16. }
  17. public override Document OnLoad(Stream input)
  18. {
  19. using (Image image = PdnResources.LoadImage(input))
  20. {
  21. Document document = Document.FromImage(image);
  22. return document;
  23. }
  24. }
  25. }
  26. }