Resize the image with the specified resizing type, allowing for flexible adjustment of dimensions while preserving aspect ratio or applying specific scaling algorithms. Integrate this method into your image processing workflow to achieve precise resizing operations tailored to your application’s requirements.
This example loads a WMF image and resizes it using various resizing methods.
[C#]stringdir="c:\\temp\\";using(Aspose.Imaging.FileFormats.Wmf.WmfImageimage=(Aspose.Imaging.FileFormats.Wmf.WmfImage)Aspose.Imaging.Image.Load(dir+"sample.wmf")){// Scale up by 2 times using Nearest Neighbour resampling.image.Resize(image.Width*2,image.Height*2,Aspose.Imaging.ResizeType.NearestNeighbourResample);}using(Aspose.Imaging.FileFormats.Wmf.WmfImageimage=(Aspose.Imaging.FileFormats.Wmf.WmfImage)Aspose.Imaging.Image.Load(dir+"sample.wmf")){// Scale down by 2 times using Nearest Neighbour resampling.image.Resize(image.Width/2,image.Height/2,Aspose.Imaging.ResizeType.NearestNeighbourResample);}using(Aspose.Imaging.FileFormats.Wmf.WmfImageimage=(Aspose.Imaging.FileFormats.Wmf.WmfImage)Aspose.Imaging.Image.Load(dir+"sample.wmf")){// Scale up by 2 times using Bilinear resampling.image.Resize(image.Width*2,image.Height*2,Aspose.Imaging.ResizeType.BilinearResample);}using(Aspose.Imaging.FileFormats.Wmf.WmfImageimage=(Aspose.Imaging.FileFormats.Wmf.WmfImage)Aspose.Imaging.Image.Load(dir+"sample.wmf")){// Scale down by 2 times using Bilinear resampling.image.Resize(image.Width/2,image.Height/2,Aspose.Imaging.ResizeType.BilinearResample);}
Adjust the size of the image based on specified settings, enabling precise control over dimensions, aspect ratio, and scaling behavior. Integrate this method into your image processing workflow to achieve customized resizing operations tailored to the specific requirements of your application.