---
title: "Resize..::.CalculateProportionalDimensions Method (Int32, Int32, 
            Int32
          %, 
            Int32
          %, ResizeMode)"
canonical: https://www.graphicsmill.com/docs/gm5/M_Aurigma_GraphicsMill_Transforms_Resize_CalculateProportionalDimensions_5_803a6bf6.htm
product: "Graphics Mill 5.5 for .NET"
---

This documentation is for the old version. [Go to the latest Graphics Mill docs](https://www.graphicsmill.com/docs/gm/)

# Resize.CalculateProportionalDimensions Method (Int32, Int32, Int32 %, Int32 %, ResizeMode)
 
Calculates parameters for resize which preserve the aspect ratio of specified dimensions.
 
**Namespace:** [Aurigma.GraphicsMill.Transforms](https://www.graphicsmill.com/docs/gm5/N_Aurigma_GraphicsMill_Transforms.htm.md)
 **Assembly:** Aurigma.GraphicsMill (in Aurigma.GraphicsMill.dll)
 
## Syntax
  
```
Public Shared Sub CalculateProportionalDimensions ( _srcWidth As Integer, _srcHeight As Integer, _ByRef destWidth As Integer, _ByRef destHeight As Integer, _mode As ResizeMode _
)
```
 
```csharp
public static void CalculateProportionalDimensions(int srcWidth,int srcHeight,ref int destWidth,ref int destHeight,ResizeMode mode
)
```
 
### Parameters
 
 - srcWidth
     - Type: [System.Int32](http://msdn2.microsoft.com/en-us/td2s409d)
Input width.

 - srcHeight
     - Type: [System.Int32](http://msdn2.microsoft.com/en-us/td2s409d)
Input height.

 - destWidth
     - Type: [System.Int32](http://msdn2.microsoft.com/en-us/td2s409d) %
Width value you need to recalculate. This value may be changed depending on the *mode* argument value.

 - destHeight
     - Type: [System.Int32](http://msdn2.microsoft.com/en-us/td2s409d) %
Height value you need to recalculate. This value may be changed depending on the *mode* argument value.

 - mode
     - Type: [Aurigma.GraphicsMill.Transforms.ResizeMode](https://www.graphicsmill.com/docs/gm5/T_Aurigma_GraphicsMill_Transforms_ResizeMode.htm.md)
 [ResizeMode](https://www.graphicsmill.com/docs/gm5/T_Aurigma_GraphicsMill_Transforms_ResizeMode.htm.md) value which specifies how to interpret *destWidth* and *destHeight* value.
 
## Remarks
  
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](https://www.graphicsmill.com/docs/gm5/T_Aurigma_GraphicsMill_Transforms_ResizeMode.htm.md). 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:
 
- **srcWidth**Width of the bitmap which you are going to resize.
- **srcBitmap**Height of the bitmap which you are going to resize.
- **destWidth**An integer variable which is equal to 640.
- **destHeight**An integer variable which is equal to 480
- **mode** [Fit](https://www.graphicsmill.com/docs/gm5/T_Aurigma_GraphicsMill_Transforms_ResizeMode.htm.md)

After you run this method, variables you pass as *destWidth* and *destHeight* will store recalculated dimensions.
   
## See Also

### Reference

- [Resize Class](https://www.graphicsmill.com/docs/gm5/T_Aurigma_GraphicsMill_Transforms_Resize.htm.md)
- [CalculateProportionalDimensions Overload](https://www.graphicsmill.com/docs/gm5/O_T_Aurigma_GraphicsMill_Transforms_Resize_CalculateProportionalDimensions.htm.md)
- [Aurigma.GraphicsMill.Transforms Namespace](https://www.graphicsmill.com/docs/gm5/N_Aurigma_GraphicsMill_Transforms.htm.md)
