DEXTUpload.NET Professional
menu toggleReferences > DEXTUpload.NET > ResizingOption

DEXTUpload.NET
Class ResizingOption

The minimum supported version
5.0.0.0
The minimum support environment
.NET Framework 4.0
Explanation

The "ResizingOption" is a class that contains the settings required when resizing the original image.

The "ResizingOption" object is used as a parameter of the "Resize" method of the "DEXTUpload.NET.ImageProc" class.

var source = new FileInfo("source.jpg");

var resizedImage1 = ImageProc.Resize(source, new PatternOption {
    Width = 100, 
    Height = 200
});

var resizedImage2 = ImageProc.Resize(source, new PatternOption {
    Width = 50, 
    Unit = ImageResizeUnit.Percentage, 
    PreserveAspectRatio = true
});
Type
public class ResizingOption
Constructors

ResizingOption

  • Does initialization when creating an instance of the "ResizingOption" class.

  • Type

    public ResizingOption()
    public ResizingOption(int width, int height, ImageResizeUnit unit, bool preserveAspectRatio, bool antialiasing)
  • Parameters

    Name Type Explanation
    width System.Int32 The horizontal size to resize.
    height System.Int32 The vertical size to resize.
    unit DEXTUpload.NET.ImageResizeUnit A value of the "ImageResizeUnit" enumeration that represents horizontal or vertical unit when resizing
    preserveAspectRatio System.Boolean Whether or not you want to maintain the original ratio.
    antialiasing System.Boolean Whether or not to apply the anti-aliasing effect.
Properties

Width

  • Gets or sets the horizontal size to change.

    If the "PreserveAspectRatio" property is "true", the "Width" property is automatically calculated with respect to the value of the "Height" property.

    The default value is 0.

  • Type

    public int Width { get; set; }

Height

  • Gets or sets the vertical size to change.

    If the "PreserveAspectRatio" property is "true", the "Height" property is automatically calculated with respect to the value of the "Width" property.

    The default value is 0.

  • Type

    public int Height { get; set; }

Unit

  • Gets or sets a member of "DEXTUpload.NET.ImageResizeUnit" enumeration that represents horizontal or vertical unit when resizing

    By default, it is "ImageResizeUnit.Pixel".

  • Type

    public ImageResizeUnit Unit { get; set; }

PreserveAspectRatio

  • Gets or sets whether or not to maintain the aspect ratio of the original image.

    To maintain the original ratio, the one of the "Width" or "Height" properties is 0, the another must be greater than 0. If both are larget positive number than 0, the aspect ratio won't be maintained. Then, if both are 0, the image of the 1x1 pixel size is generated.

    By default, it is "false".

  • Type

    public bool PreserveAspectRatio { get; set; }

UseAntialiasing

  • Gets or sets whether or not to apply the anti-aliasing effect.

    By default, it is "true".

  • Type

    public bool UseAntialiasing { get; set; }