PdnFileTypes.cs 1.4 KB

1234567891011121314151617181920212223242526272829303132333435
  1. using PaintDotNet.Data;
  2. using System.Drawing.Imaging;
  3. namespace PaintDotNet
  4. {
  5. public class PdnFileTypes
  6. : IFileTypeFactory
  7. {
  8. public static readonly FileType Bmp = new BmpFileType();
  9. public static readonly FileType Jpeg = new JpegFileType();
  10. public static readonly FileType Gif = new GifFileType();
  11. public static readonly FileType Tiff = new GdiPlusFileType("TIFF", ImageFormat.Tiff, false, new string[] { ".tif", ".tiff" });
  12. public static readonly PngFileType Png = new PngFileType();
  13. public static readonly FileType Tga = new TgaFileType();
  14. private static FileType[] fileTypes = new FileType[] {
  15. Bmp,
  16. Gif,
  17. Jpeg,
  18. Png,
  19. Tiff,
  20. Tga
  21. };
  22. internal FileTypeCollection GetFileTypeCollection()
  23. {
  24. return new FileTypeCollection(fileTypes);
  25. }
  26. public FileType[] GetFileTypeInstances()
  27. {
  28. return (FileType[])fileTypes.Clone();
  29. }
  30. }
  31. }