示例#1
0
        private static void OnChanged(object sender, FileSystemEventArgs e)
        {
            string changedFullPath = e.FullPath;

            using (IEncoderEngine encoderEngine = EncoderEngine.CreateEncoderEngine(changedFullPath))
            {
                encoderEngine.EncodeToJPG();
            }
            ISaveFile saveFile = SaveFile.CreateSaveFile(changedFullPath);

            saveFile.SaveToArchiveFolder();
        }
示例#2
0
        private static void EncodeAll(string folderName)
        {
            string[] filePathsArray = Directory.GetFiles(folderName, "*.bmp");

            foreach (string path in filePathsArray)
            {
                Console.WriteLine(path);
                using (IEncoderEngine encoderEngine = EncoderEngine.CreateEncoderEngine(path))
                {
                    encoderEngine.EncodeToJPG();
                }
                ISaveFile saveFile = SaveFile.CreateSaveFile(path);
                saveFile.SaveToArchiveFolder();
            }

            Console.WriteLine("Done Encoding.  Click space to exit.");
            Console.ReadKey();
        }
示例#3
0
 private static void EncodeSingle(string fileName)
 {
     if (File.Exists(fileName))
     {
         using (IEncoderEngine encoderEngine = EncoderEngine.CreateEncoderEngine(fileName))
         {
             encoderEngine.EncodeToJPG();
         }
         ISaveFile saveFile = SaveFile.CreateSaveFile(fileName);
         saveFile.SaveToArchiveFolder();
         Console.WriteLine("Done encoding file: " + fileName);
         Console.ReadKey();
     }
     else
     {
         Console.WriteLine("Could not find file: " + fileName);
         Console.ReadKey();
     }
 }