diff --git a/src/ImageProcessor/Samplers/ImageSampleExtensions.cs b/src/ImageProcessor/Samplers/ImageSampleExtensions.cs index 6b2c0bacf..6e12d3d92 100644 --- a/src/ImageProcessor/Samplers/ImageSampleExtensions.cs +++ b/src/ImageProcessor/Samplers/ImageSampleExtensions.cs @@ -32,12 +32,12 @@ namespace ImageProcessor.Samplers /// The public static Image Resize(this Image source, int width, int height, IResampler sampler) { - return Resize(source, width, height, sampler, source.Bounds, new Rectangle(0, 0, width, height)); + return Resize(source, width, height, sampler, source.Bounds); } /// - /// Resizes an image to the given width and height with the given sampler, - /// source rectangle, and target rectangle. + /// Resizes an image to the given width and height with the given sampler and + /// source rectangle. /// /// The image to resize. /// The target image width. @@ -46,14 +46,10 @@ namespace ImageProcessor.Samplers /// /// The structure that specifies the portion of the image object to draw. /// - /// - /// The structure that specifies the location and size of the drawn image. - /// The image is scaled to fit the rectangle. - /// /// The - public static Image Resize(this Image source, int width, int height, IResampler sampler, Rectangle sourceRectangle, Rectangle targetRectangle) + public static Image Resize(this Image source, int width, int height, IResampler sampler, Rectangle sourceRectangle) { - return source.Process(width, height, sourceRectangle, targetRectangle, new Resize(sampler)); + return source.Process(width, height, sourceRectangle, new Rectangle(0, 0, width, height), new Resize(sampler)); } /// @@ -65,12 +61,11 @@ namespace ImageProcessor.Samplers /// The public static Image Crop(this Image source, int width, int height) { - return Crop(source, width, height, source.Bounds, new Rectangle(0, 0, width, height)); + return Crop(source, width, height, source.Bounds); } /// - /// Crops an image to the given width and height with the given source rectangle, - /// and target rectangle. + /// Crops an image to the given width and height with the given source rectangle. /// /// If the source rectangle is smaller than the target dimensions then the /// area within the source is resized performing a zoomed crop. @@ -82,21 +77,17 @@ namespace ImageProcessor.Samplers /// /// The structure that specifies the portion of the image object to draw. /// - /// - /// The structure that specifies the location and size of the drawn image. - /// The image is cropped to fit the rectangle. - /// /// The - public static Image Crop(this Image source, int width, int height, Rectangle sourceRectangle, Rectangle targetRectangle) + public static Image Crop(this Image source, int width, int height, Rectangle sourceRectangle) { - if (sourceRectangle.Width < targetRectangle.Width || sourceRectangle.Height < targetRectangle.Height) + if (sourceRectangle.Width < width || sourceRectangle.Height < height) { // If the source rectangle is smaller than the target perform a // cropped zoom. source = source.Resize(sourceRectangle.Width, sourceRectangle.Height); } - return source.Process(width, height, sourceRectangle, targetRectangle, new Crop()); + return source.Process(width, height, sourceRectangle, new Rectangle(0, 0, width, height), new Crop()); } } }