PngFileType.cs 567 B

123456789101112131415161718192021222324
  1. using System.Drawing;
  2. using System.IO;
  3. namespace PaintDotNet
  4. {
  5. public sealed class PngFileType
  6. : InternalFileType
  7. {
  8. public PngFileType()
  9. : base("PNG", FileTypeFlags.SupportsLoading | FileTypeFlags.SupportsSaving, new string[] { ".png" })
  10. {
  11. }
  12. public override Document OnLoad(Stream input)
  13. {
  14. using (Image image = PdnResources.LoadImage(input))
  15. {
  16. Document document = Document.FromImage(image);
  17. return document;
  18. }
  19. }
  20. }
  21. }