---
title: "Resize..::.CalculateProportionalDimensions Method (Bitmap, 
            Int32
          %, 
            Int32
          %, ResizeMode)"
canonical: https://www.graphicsmill.com/docs/gm5/M_Aurigma_GraphicsMill_Transforms_Resize_CalculateProportionalDimensions_4_fe1d7a14.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 (Bitmap, Int32 %, Int32 %, ResizeMode)
 
Calculates parameters for resize which preserve aspect ratio of the specified bitmap.
 
**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 ( _srcBitmap As Bitmap, _ByRef destWidth As Integer, _ByRef destHeight As Integer, _mode As ResizeMode _
)
```
 
```csharp
public static void CalculateProportionalDimensions(Bitmap srcBitmap,ref int destWidth,ref int destHeight,ResizeMode mode
)
```
 
### Parameters
 
 - srcBitmap
     - Type: [Aurigma.GraphicsMill.Bitmap](https://www.graphicsmill.com/docs/gm5/T_Aurigma_GraphicsMill_Bitmap.htm.md)
 [Bitmap](https://www.graphicsmill.com/docs/gm5/T_Aurigma_GraphicsMill_Bitmap.htm.md) class instance which aspect ratio you should to preserve.

 - 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 aspect ratio of the input bitmap 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:
 
- **srcBitmap**An instance 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)
