Packages

 

com.aspose.imaging

Interfaces

Classes

Exceptions

com.aspose.imaging

Class ResizeType

  • java.lang.Object
    • com.aspose.ms.System.ValueType<com.aspose.ms.System.Enum>
      • com.aspose.ms.System.Enum
        • com.aspose.imaging.ResizeType


  • public final class ResizeType
    extends com.aspose.ms.System.Enum

    Specifies the resize type.

    Code example:

    This example loads an image and resizes it using various resizing methods.


    String dir = "c:\\temp\\";
    
    com.aspose.imaging.Image image = com.aspose.imaging.Image.load(dir + "sample.gif");
    try {
        // Scale up by 2 times using Nearest Neighbour resampling.
        image.resize(image.getWidth() * 2, image.getHeight() * 2, com.aspose.imaging.ResizeType.NearestNeighbourResample);
        image.save(dir + "upsample.nearestneighbour.gif");
    } finally {
        image.dispose();
    }
    
    image = com.aspose.imaging.Image.load(dir + "sample.gif");
    try {
        // Scale down by 2 times using Nearest Neighbour resampling.
        image.resize(image.getWidth() / 2, image.getHeight() / 2, com.aspose.imaging.ResizeType.NearestNeighbourResample);
        image.save(dir + "downsample.nearestneighbour.gif");
    } finally {
        image.dispose();
    }
    
    image = com.aspose.imaging.Image.load(dir + "sample.gif");
    try {
        // Scale up by 2 times using Bilinear resampling.
        image.resize(image.getWidth() * 2, image.getHeight() * 2, com.aspose.imaging.ResizeType.BilinearResample);
        image.save(dir + "upsample.bilinear.gif");
    } finally {
        image.dispose();
    }
    
    image = com.aspose.imaging.Image.load(dir + "sample.gif");
    try {
        // Scale down by 2 times using Bilinear resampling.
        image.resize(image.getWidth() / 2, image.getHeight() / 2, com.aspose.imaging.ResizeType.BilinearResample);
        image.save(dir + "downsample.bilinear.gif");
    } finally {
        image.dispose();
    }
    

    • Nested Class Summary

      • Nested classes/interfaces inherited from class com.aspose.ms.System.Enum

        com.aspose.ms.System.Enum.AbstractEnum, com.aspose.ms.System.Enum.FlaggedEnum, com.aspose.ms.System.Enum.ObjectEnum, com.aspose.ms.System.Enum.SimpleEnum
    • Field Summary

      Fields 
      Modifier and Type Field and Description
      static int AdaptiveResample
      Resample using adaptive algorithm based on weighted and blended rational function and lanczos3 interpolation algorithms.
      static int Bell
      The Bell interpolation method
      static int BilinearResample
      Resample using bilinear interpolation.
      static int CatmullRom
      The Catmull-Rom cubic interpolation method.
      static int CenterToCenter
      Center of the new image will coincide with the center of the original image.
      static int CubicBSpline
      The CubicBSpline cubic interpolation method
      static int CubicConvolution
      The Cubic Convolution interpolation method
      static int HighQualityResample
      The high quality resample
      static int LanczosResample
      Resample using lanczos algorithm with a=3.
      static int LeftBottomToLeftBottom
      Left bottom point of the new image will coincide with the left bottom point of the original image.
      static int LeftTopToLeftTop
      Left top point of the new image will coincide with the left top point of the original image.
      static int Mitchell
      The Mitchell cubic interpolation method
      static int NearestNeighbourResample
      Resample using nearest neighbour algorithm.
      static int None
      The pixels are not preserved during resize operation.
      static int RightBottomToRightBottom
      Right bottom point of the new image will coincide with the right bottom point of the original image.
      static int RightTopToRightTop
      Right top point of the new image will coincide with the right top point of the original image.
      static int SinC
      The Sinc (Lanczos3) cubic interpolation method
      • Fields inherited from class com.aspose.ms.System.Enum

        EnumSeparatorCharArray
    • Method Summary

      • Methods inherited from class com.aspose.ms.System.Enum

        Clone, CloneTo, format, format, get_Caption, get_Value, getName, getName, getNames, getNames, getNames, getUnderlyingType, getUnderlyingType, getValue, getValues, getValues, getValues, isDefined, isDefined, isDefined, isDefined, parse, parse, parse, parse, register, toObject, toString
    • Field Detail

      • None

        public static final int None

        The pixels are not preserved during resize operation.

        See Also:
        Constant Field Values
      • LeftTopToLeftTop

        public static final int LeftTopToLeftTop

        Left top point of the new image will coincide with the left top point of the original image. Crop will occur if required.

        See Also:
        Constant Field Values
      • RightTopToRightTop

        public static final int RightTopToRightTop

        Right top point of the new image will coincide with the right top point of the original image. Crop will occur if required.

        See Also:
        Constant Field Values
      • RightBottomToRightBottom

        public static final int RightBottomToRightBottom

        Right bottom point of the new image will coincide with the right bottom point of the original image. Crop will occur if required.

        See Also:
        Constant Field Values
      • LeftBottomToLeftBottom

        public static final int LeftBottomToLeftBottom

        Left bottom point of the new image will coincide with the left bottom point of the original image. Crop will occur if required.

        See Also:
        Constant Field Values
      • CenterToCenter

        public static final int CenterToCenter

        Center of the new image will coincide with the center of the original image. Crop will occur if required.

        See Also:
        Constant Field Values
      • LanczosResample

        public static final int LanczosResample

        Resample using lanczos algorithm with a=3.

        See Also:
        Constant Field Values
      • NearestNeighbourResample

        public static final int NearestNeighbourResample

        Resample using nearest neighbour algorithm.

        See Also:
        Constant Field Values
      • AdaptiveResample

        public static final int AdaptiveResample

        Resample using adaptive algorithm based on weighted and blended rational function and lanczos3 interpolation algorithms.

        See Also:
        Constant Field Values
      • BilinearResample

        public static final int BilinearResample

        Resample using bilinear interpolation. Image pre-filtering is allowed to remove the noice before resample, when needed

        See Also:
        Constant Field Values
      • HighQualityResample

        public static final int HighQualityResample

        The high quality resample

        See Also:
        Constant Field Values
      • CatmullRom

        public static final int CatmullRom

        The Catmull-Rom cubic interpolation method.

        See Also:
        Constant Field Values
      • CubicConvolution

        public static final int CubicConvolution

        The Cubic Convolution interpolation method

        See Also:
        Constant Field Values
      • CubicBSpline

        public static final int CubicBSpline

        The CubicBSpline cubic interpolation method

        See Also:
        Constant Field Values
      • Mitchell

        public static final int Mitchell

        The Mitchell cubic interpolation method

        See Also:
        Constant Field Values
      • SinC

        public static final int SinC

        The Sinc (Lanczos3) cubic interpolation method

        See Also:
        Constant Field Values