public ImagingService(string appSid, string appKey) : base(appSid, appKey) { AppSid = appSid; AppKey = appKey; Bmp = new BmpClass(AppSid, AppKey); Crop = new CropClass(AppSid, AppKey); Frame = new FramesClass(AppSid, AppKey); Gif = new GifClass(AppSid, AppKey); Jpg = new JpgClass(AppSid, AppKey); Png = new PngClass(AppSid, AppKey); Properties = new PropertiesClass(AppSid, AppKey); Psd = new PsdClass(AppSid, AppKey); Resize = new ResizeClass(AppSid, AppKey); RotateFlip = new RotateFlipClass(AppSid, AppKey); SaveAs = new SaveAsClass(AppSid, AppKey); Tiff = new TiffClass(AppSid, AppKey); UpdateImage = new UpdateImageClass(AppSid, AppKey); }
static void Main(string[] args) { int width = Convert.ToInt32(ConfigurationManager.AppSettings["width"]); int height = Convert.ToInt32(ConfigurationManager.AppSettings["height"]); string pathIn = ConfigurationManager.AppSettings["pathIn"]; string pathOut = ConfigurationManager.AppSettings["pathOut"]; var x = new ResizeClass(pathIn, pathOut, width, height); x.ResizeTaskArray(); Console.WriteLine("Press F1 button to stop resizing"); while (true) { if (Console.ReadKey().Key == ConsoleKey.F1) { x.cancelTokenSource.Cancel(); Console.WriteLine("Resizing cancelled"); break; } } Console.ReadLine(); }