DEXTUpload.NET Professional
menu toggleReferences > DEXTUpload.NET > ImageResizeUnit

DEXTUpload.NET
Enumeration ImageResizeUnit

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

The "ImageResizeUnit" is an enumeration type that represents a horizontal or vertical unit when resizing the original image.

To resize the image, the "Resize" method of the "DEXTUpload.NET.ImageProc class uses. This method get a "DEXTUpload.NET.ResizingOption" object as a parameter. The "DEXTUpload.NET.ResizingOption" class has a property to set the unit needed to resize.

var source = new FileInfo("source.jpg");
using (var img = ImageProc.Resize(source, new ResizingOption { 
    Width = 50, Height = 20, 
    // Change the size to 50% horizontal and 20% vertical.
    Unit = ImageResizeUnit.Percentage }))
{
    ImageProc.SaveImage(img, new FileInfo("output.jpg"), new ImageSaveOption { IsOverwrite = true });
}
Type
public enum ImageResizeUnit
Members

Pixel

  • Using pixel as the unit of size.

    Source Change size Result
    source
    120x84 >
    100x150
    resizing

Percentage

  • Using percentage(%) as the unit of size.

    Source Change size Result
    source
    120x84 >
    50%x200%
    resizing