Create a Thumbnail of an Image, based on input image file, and a max size factor to resize the image.
The extension has two inputs:
- The 'SourceImageBin';
- MaxSize.
The max size is to calculate the thumbnail proportion.
The calc is based on the follwing formula:
if (ImageOriginal.Width > (ImageOriginal.Width .Height)
{
return new Size(MaxSize,(int)(((double)(ImageOriginal.Width .Height / (double)(ImageOriginal.Width .Width) * MaxSize));
}
else
return new Size((int)(((double)(ImageOriginal.Width .Width / (double)(ImageOriginal.Width .Height) * MaxSize), MaxSize);