From ab270643babc9d5aff4ae106f53b7554c4f6a1c7 Mon Sep 17 00:00:00 2001 From: James Jackson-South Date: Mon, 5 Sep 2016 22:33:08 +1000 Subject: [PATCH] Add resize overload Former-commit-id: f4c7cb3a87ffdf88a55339c10967c8b35225c37a Former-commit-id: 538c2a48e661b6563fbd9f3be82237b6552f793b Former-commit-id: 7bdd802e524bd1480e22c09da91499ea21f80ea4 --- src/ImageProcessorCore/Samplers/Resize.cs | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/ImageProcessorCore/Samplers/Resize.cs b/src/ImageProcessorCore/Samplers/Resize.cs index e2eb5775cb..62d482b917 100644 --- a/src/ImageProcessorCore/Samplers/Resize.cs +++ b/src/ImageProcessorCore/Samplers/Resize.cs @@ -79,6 +79,25 @@ namespace ImageProcessorCore return Resize(source, width, height, new BicubicResampler(), compand, progressHandler); } + /// + /// Resizes an image to the given width and height with the given sampler. + /// + /// The pixel format. + /// The packed format. uint, long, float. + /// The image to resize. + /// The target image width. + /// The target image height. + /// The to perform the resampling. + /// A delegate which is called as progress is made processing the image. + /// The + /// Passing zero for one of height or width will automatically preserve the aspect ratio of the original image + public static Image Resize(this Image source, int width, int height, IResampler sampler, ProgressEventHandler progressHandler = null) + where TColor : IPackedVector + where TPacked : struct + { + return Resize(source, width, height, sampler, false, progressHandler); + } + /// /// Resizes an image to the given width and height with the given sampler. ///