Calculates parameters for resize which preserve the aspect ratio of specified dimensions.
Namespace:
Aurigma.GraphicsMill.Transforms
Assembly:
Aurigma.GraphicsMill (in Aurigma.GraphicsMill.dll)
Public Shared Sub CalculateProportionalDimensions ( _ srcWidth As Integer, _ srcHeight As Integer, _ ByRef destWidth As Integer, _ ByRef destHeight As Integer, _ mode As ResizeMode _ )
public static void CalculateProportionalDimensions( int srcWidth, int srcHeight, ref int destWidth, ref int destHeight, ResizeMode mode )
Type: System.Int32
Input width.Type: System.Int32
Input height.Type: System.Int32 %
Width value you need to recalculate. This value may be changed depending on the mode argument value.Type: System.Int32 %
Height value you need to recalculate. This value may be changed depending on the mode argument value.Type: Aurigma.GraphicsMill.Transforms.ResizeMode
ResizeMode value which specifies how to interpret destWidth and destHeight value.Use this method if you need to get the exact dimensions of the bitmap after proportional resize. This method recalculates specified width and height to preserve the specified aspect ratio respecting the specified ResizeMode. Note, destWidth and destHeight are both in and out, and these values are changed by the method.
For example, you need to make sure that the bitmap after resize will fit 640x480 rectangle. In this case you should pass the following values:
After you run this method, variables you pass as destWidth and destHeight will store recalculated dimensions.