//возвращает размеры до и после public static List <double> lessImageSet(string path) { try { path = DATA.imageDict[path]; List <double> sizes = new List <double>(); double size1 = FILEWORK.sizeOfFile(path); var imgStream = File.OpenRead(path); Image yourImage = Image.FromStream(imgStream); //загрузили изображение imgStream.Close(); //закрыли поток Size sz = nwSizeMain(yourImage); yourImage = resizeImage(yourImage, sz); //изменили размер string finPath = path; yourImage.Save(finPath, ImageFormat.Jpeg); //сохранили double size2 = FILEWORK.sizeOfFile(finPath); reportTransformImage(path, size1, size2); sizes.Add(size1); sizes.Add(size2); return(sizes); } catch (Exception e) { Console.WriteLine("ERROR: обработки изображения " + path); Console.WriteLine(e.Message); return(new List <double>()); } }
public static void INIT() { header1 = FILEWORK.ReadFileContent(PATH.templ + "\\header1.txt"); footer1 = FILEWORK.ReadFileContent(PATH.templ + "\\footer1.txt"); header2 = FILEWORK.ReadFileContent(PATH.templ + "\\header2.txt"); footer2 = FILEWORK.ReadFileContent(PATH.templ + "\\footer2.txt"); youtube1 = FILEWORK.ReadFileContent(PATH.templ + "\\youtube1.txt"); youtube2 = FILEWORK.ReadFileContent(PATH.templ + "\\youtube2.txt"); youtube3 = FILEWORK.ReadFileContent(PATH.templ + "\\youtube3.txt"); youtubeTravel = FILEWORK.ReadFileContent(PATH.templ + "\\youtubeTravel.txt"); youtubeRight = FILEWORK.ReadFileContent(PATH.templ + "\\youtubeRight.txt"); }
public static void Main(string[] args) { //var test = new Test1(); //Console.ReadKey(); bool serv = false; //string s1 = niceString("123123", "sdfsdf", "sdfsdf", 50, 50); //Console.WriteLine(s1); //string s2 = niceString("1231sdfsdfsdf23", "sdfsaaaadf", "sdfsdf", 50, 50); //Console.WriteLine(s2); //Console.ReadKey(); //return; string procName = Process.GetCurrentProcess().ProcessName; if (Process.GetProcessesByName(procName).Length != 1) { Console.WriteLine("УЖЕ ЕСТЬ ЕЩЕ ОДИН ЭКЗЕМПЛЯР ПРОГРАММЫ"); Console.WriteLine("Press any key to continue..."); Console.ReadKey(); return; } // Console.SetWindowSize(Console.LargestWindowWidth, Console.LargestWindowHeight); // ShowWindow(ThisConsole, MAXIMIZE); //ShowWindow(ThisConsole, MAXIMIZE); //Thread.Sleep(1000); //Console.SetWindowSize(Console.WindowWidth, Console.LargestWindowHeight-1); var stage1 = new Stage1("ПРОВЕРКА"); var stage2 = new Stage2("ДОБАВЛЯЕМ"); var stage3 = new Stage3("ОБРАБОКА ФОТОГРАФИЙ"); var stage4 = new Stage4("СОЗДАНИЕ МОДЕЛЕЙ"); var stage5 = new Stage5("WORKOUT CREATING..."); var stage6 = new Stage6("FRIENDS CREATING..."); var stage7 = new Stage7("DOGANDCAT CREATING..."); var stage8 = new Stage8("SPORT CREATING..."); var stage9 = new Stage9("FOOD CREATING..."); var stage10 = new Stagef10("TRAVEL CREATING..."); var stage11 = new Stage11("CONTACT CREATING..."); var stage12 = new Stage12("INDEX CREATING..."); var stage13 = new Stage13("REPORT CREATING..."); var stage14 = new Stage14("RANDOMOPENER CREATE..."); var stage15 = new Stage15("BOOK CREATE..."); Console.WriteLine(""); Console.WriteLine(DateTime.Now.ToString()); Console.WriteLine(""); Console.WriteLine(""); Console.WriteLine(""); Stopwatch stopwatch = new Stopwatch(); // Begin timing. stopwatch.Start(); PATH.INIT(); CONST.INIT(); PATH.checking(); FILEWORK.SIZE(); stage1.EXECUTE(); stage2.EXECUTE(); stage3.EXECUTE(); stage4.EXECUTE(); if (serv) { var serv1 = new Service1(); serv1.EXECUTE(); Console.WriteLine("Press any key to continue..."); Console.ReadKey(); return; } stage15.EXECUTE(); stage14.EXECUTE(); stage5.EXECUTE(); stage6.EXECUTE(); stage7.EXECUTE(); stage8.EXECUTE(); stage9.EXECUTE(); stage15.EXECUTE(); stage10.EXECUTE(); stage11.EXECUTE(); stage12.EXECUTE(); stage13.EXECUTE(); COUNTER.count(); // Stop timing. stopwatch.Stop(); //var wo = new WORKOUT(); //Console.WriteLine(wo._type); // Write result. Console.WriteLine("Time elapsed: {0}", stopwatch.Elapsed); Console.WriteLine("Press any key to continue..."); Console.ReadKey(); }