/// <summary> /// Resizes the image. /// </summary> /// <param name="inputFilename">The input filename.</param> /// <param name="outputFilename">The output filename.</param> /// <param name="width">The desired width of the output image.</param> /// <param name="height">The desired height of the output image.</param> /// <param name="method">The resize calculation method</param> /// <param name="anchorLocation">The anchor location.</param> /// <param name="jpegQuality">The JPEG quality.</param> /// <param name="outputFormat">The output format.</param> public static void ResizeImage(string inputFilename, string outputFilename, int width, int height, ResizeMethod method = ResizeMethod.KeepAspectRatio, AnchorLocation anchorLocation = AnchorLocation.Middle, long jpegQuality = 80L, ImageFormatType outputFormat = ImageFormatType.Default) { ImageProcessor processor = new ImageProcessor(new ResizeFilter(width, height, method, anchorLocation)); ResizeFilter filter = new ResizeFilter(width, height, method, anchorLocation); processor.JpegCompression = jpegQuality; processor.OutputFormat = outputFormat; processor.ProcessImage(inputFilename, outputFilename); }