JpegFileType.cs 657 B

123456789101112131415161718192021222324252627
  1. using System.Drawing;
  2. using System.IO;
  3. namespace PaintDotNet
  4. {
  5. public sealed class JpegFileType : FileType
  6. {
  7. public JpegFileType()
  8. : base("JPEG", FileTypeFlags.SupportsLoading | FileTypeFlags.SupportsSaving, new string[] { ".jpg", ".jpeg", ".jpe", ".jfif" })
  9. {
  10. }
  11. public enum PropertyNames
  12. {
  13. Quality = 0
  14. }
  15. public override Document OnLoad(Stream input)
  16. {
  17. using (Image image = PdnResources.LoadImage(input))
  18. {
  19. Document document = Document.FromImage(image);
  20. return document;
  21. }
  22. }
  23. }
  24. }