Class SizeUtil
Size calculating functions
Inheritance
System.Object
SizeUtil
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: ImageVault.Common.Lib.Drawing
Assembly: ImageVault.Common.dll
Syntax
public static class SizeUtil
Methods
FitInsideBounds(Int32, Int32, Int32, Int32, Boolean)
Calculates the size that the oringinal image needs to be to fit inside the supplied bounds while retaining it's original aspect ratio.
Declaration
public static Size FitInsideBounds(int imageWidth, int imageHeight, int boundsWidth, int boundsHeight, bool allowGrowth)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | imageWidth | The width of the original image |
System.Int32 | imageHeight | The height of the original image |
System.Int32 | boundsWidth | The width of the outer bounds to fit inside |
System.Int32 | boundsHeight | The height of the outer bounds to fit inside |
System.Boolean | allowGrowth | True if we allow expanding the image to fit inside the bounds, false if we only allow shrink |
Returns
Type | Description |
---|---|
System.Drawing.Size | The resulting sizeSystem.Drawing.Size |