Пример #1
0
 public static void SaveFile(PNM bitmap, string path, PNMFormat format)
 {
     using (FileStream stream = File.Open(path, FileMode.Create, FileAccess.Write))
     {
         switch (format)
         {
             case PNMFormat.PBM:
                 RawPBM.SaveFile(bitmap, stream);
                 break;
             case PNMFormat.PGM:
                 RawPGM.SaveFile(bitmap, stream);
                 break;
             case PNMFormat.PPM:
                 RawPPM.SaveFile(bitmap, stream);
                 break;
             default:
                 throw new ArgumentException("format");
         }
     }
 }
Пример #2
0
        public static void SaveFile(PNM bitmap, string path, PNMFormat format)
        {
            using (FileStream stream = File.Open(path, FileMode.Create, FileAccess.Write))
            {
                switch (format)
                {
                case PNMFormat.PBM:
                    RawPBM.SaveFile(bitmap, stream);
                    break;

                case PNMFormat.PGM:
                    RawPGM.SaveFile(bitmap, stream);
                    break;

                case PNMFormat.PPM:
                    RawPPM.SaveFile(bitmap, stream);
                    break;

                default:
                    throw new ArgumentException("format");
                }
            }
        }
Пример #3
0
 internal void SaveImage(string path, PNMFormat format)
 {
     PNM.SaveFile(Image, path, format);
     Path   = path;
     Format = format;
 }
Пример #4
0
 internal void SaveImage(string path, PNMFormat format)
 {
     PNM.SaveFile(Image, path, format);
     Path = path;
     Format = format;
 }