DEXTUpload.NET Professional
menu toggleReferences > DEXTUpload.NET > ImageVerticalAlignment

DEXTUpload.NET
Enumeration ImageVerticalAlignment

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

The "ImageVerticalAlignment" enumeration determines the vertical position for fitting a image into the specified frame with a "DEXTUpload.NET.ImageFitOption" together.

This enumeration is used only in the case of "ImageFitOption.UniformToFit" or "ImageFitOption.UniformToFill".

var source = new FileInfo("source.jpg");
using (var img = ImageProc.Fit(source, new FittingOption { 
    Width = 100, Height = 200, Fit = ImageFitOption.UniformToFit,
    BackgroundColor = Color.Red,
    // If you have upper and lower margins, you can fit by the bottom and fill the top margins with the background color.
    VerticalAlign = ImageVerticalAlignment.Bottom }))
{
    ImageProc.SaveImage(img, new FileInfo("output.jpg"), new ImageSaveOption { IsOverwrite = true });
}
Type
public enum ImageVerticalAlignment
Members

Top

  • Based on the top.

    If the "Fit" property is "ImageFitOption.UniformToFit"

    Source Frame Result
    source
    fitting

    If the "Fit" property is "ImageFitOption.UniformToFill"

    Source Frame Result
    source
    fitting

Middle

  • Base on the middle.

    If the "Fit" property is "ImageFitOption.UniformToFit"

    Source Frame Result
    source
    fitting

    If the "Fit" property is "ImageFitOption.UniformToFill"

    Source Frame Result
    source
    fitting

Bottom

  • Based on the bottom.

    If the "Fit" property is "ImageFitOption.UniformToFit"

    Source Frame Result
    source
    fitting

    If the "Fit" property is "ImageFitOption.UniformToFill"

    Source Frame Result
    source
    fitting