Click or drag to resize
ResizeType Enumeration
Specifies the resize type.

Namespace: Aspose.Imaging
Assembly: Aspose.Imaging (in Aspose.Imaging.dll) Version: 20.06
Syntax
public enum ResizeType
Members
  Member nameValueDescription
None0 The pixels are not preserved during resize operation.
LeftTopToLeftTop1 Left top point of the new image will coincide with the left top point of the original image. Crop will occur if required.
RightTopToRightTop2 Right top point of the new image will coincide with the right top point of the original image. Crop will occur if required.
RightBottomToRightBottom3 Right bottom point of the new image will coincide with the right bottom point of the original image. Crop will occur if required.
LeftBottomToLeftBottom4 Left bottom point of the new image will coincide with the left bottom point of the original image. Crop will occur if required.
CenterToCenter5 Center of the new image will coincide with the center of the original image. Crop will occur if required.
LanczosResample6 Resample using lanczos algorithm with a=3.
NearestNeighbourResample7 Resample using nearest neighbour algorithm.
AdaptiveResample8 Resample using adaptive algorithm based on weighted and blended rational function and lanczos3 interpolation algorithms.
BilinearResample9 Resample using bilinear interpolation. Image pre-filtering is allowed to remove the noice before resample, when needed
HighQualityResample10 The high quality resample
Examples
This example loads an image and resizes it using various resizing methods.
[C#]

string dir = "c:\\temp\\";

using (Aspose.Imaging.Image image = Aspose.Imaging.Image.Load(dir + "sample.gif"))
{
    // Scale up by 2 times using Nearest Neighbour resampling.
    image.Resize(image.Width* 2, image.Height* 2, Aspose.Imaging.ResizeType.NearestNeighbourResample);
    image.Save(dir + "upsample.nearestneighbour.gif");
}

using (Aspose.Imaging.Image image = Aspose.Imaging.Image.Load(dir + "sample.gif"))
{
    // Scale down by 2 times using Nearest Neighbour resampling.
    image.Resize(image.Width / 2, image.Height / 2, Aspose.Imaging.ResizeType.NearestNeighbourResample);
    image.Save(dir + "downsample.nearestneighbour.gif");
}

using (Aspose.Imaging.Image image = Aspose.Imaging.Image.Load(dir + "sample.gif"))
{
    // Scale up by 2 times using Bilinear resampling.
    image.Resize(image.Width* 2, image.Height* 2, Aspose.Imaging.ResizeType.BilinearResample);
    image.Save(dir + "upsample.bilinear.gif");
}

using (Aspose.Imaging.Image image = Aspose.Imaging.Image.Load(dir + "sample.gif"))
{
    // Scale down by 2 times using Bilinear resampling.
    image.Resize(image.Width / 2, image.Height / 2, Aspose.Imaging.ResizeType.BilinearResample);
    image.Save(dir + "downsample.bilinear.gif");
}
See Also