- Aurigma Graphics Mill 5.5 for .NET
- Introduction
- What's New?
- Overview of Features
- Getting Started
- Programming with Graphics Mill for .NET
- File Formats
- Graphics Mill for .NET Add-ons
- Class Library Reference
- Aurigma.GraphicsMill Namespace
- Aurigma.GraphicsMill.AjaxControls Namespace
- Aurigma.GraphicsMill.AjaxControls.VectorObjects Namespace
- Aurigma.GraphicsMill.AjaxControls.VectorObjects.Math Namespace
- Aurigma.GraphicsMill.AjaxControls.VectorObjects.RedoUndo Namespace
- Aurigma.GraphicsMill.Codecs Namespace
- Aurigma.GraphicsMill.Drawing Namespace
- Aurigma.GraphicsMill.Licensing Namespace
- Aurigma.GraphicsMill.Transforms Namespace
- AddNoise Class
- AdjustHsl Class
- ApplyLut Class
- ApplyMatrixTransform Class
- BitmapTransform Class
- Blur Class
- BlurType Enumeration
- Brightness Class
- BrightnessContrast Class
- Buttonize Class
- ChannelBalance Class
- ColorManagementEngine Enumeration
- ColorQuantizationAlgorithm Enumeration
- ColorTransformationIntent Enumeration
- CombineMode Enumeration
- Combiner Class
- Contrast Class
- Crop Class
- Curves Class
- Cylindrize Class
- Direction Enumeration
- DistributionKind Enumeration
- DitheringType Enumeration
- EdgeDetect Class
- EdgeDetectMode Enumeration
- Emboss Class
- FadeType Enumeration
- FloodFill Class
- FloodFillMode Enumeration
- Glow Class
- HistogramEqualize Class
- InterpolationMode Enumeration
- Invert Class
- Levels Class
- Lut Class
- MaskedBitmapTransform Class
- Matrix Class
- MaximumFilter Class
- MedianFilter Class
- MinimumFilter Class
- Mosaic Class
- Orientation Enumeration
- PageCurl Class
- PerChannelBitmapTransform Class
- PixelFormatConverter Class
- RedEyeBlob Class
- RedEyeMask Class
- RedEyeRemoval Class
- RedEyeRemovalMode Enumeration
- Resize Class
- ResizeMode Enumeration
- Rotate Class
- RotateAndFlip Class
- Shadow Class
- Sharpen Class
- Solarize Class
- Spray Class
- SwapChannels Class
- Swirl Class
- Texturize Class
- Transparentize Class
- UnsharpMask Class
- Waddle Class
- WaterDrop Class
- Wave Class
- WaveType Enumeration
- Aurigma.GraphicsMill.WebControls Namespace
- Aurigma.GraphicsMill.WinControls Namespace
- GraphicsMill Namespace (Client Class Library)
- Aurigma.GraphicsMill.AjaxControls Namespace (Client Class Library)
- Aurigma.GraphicsMill.AjaxControls.VectorObjects Namespace (Client Class Library)
- Aurigma.GraphicsMill.AjaxControls.VectorObjects.Math Namespace (Client Class Library)
- Aurigma.GraphicsMill.AjaxControls.VectorObjects.RedoUndo Namespace (Client Class Library)
- Samples
- Licensing
- Copyright Notices
Resize.CalculateProportionalDimensions Method (Int32, Int32, Int32 %, Int32 %, ResizeMode)
Calculates parameters for resize which preserve the aspect ratio of specified dimensions.
Namespace:
Aurigma.GraphicsMill.Transforms
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 _
)
public static void CalculateProportionalDimensions(
int srcWidth,
int srcHeight,
ref int destWidth,
ref int destHeight,
ResizeMode mode
)
Parameters
- srcWidth
-
Type: System.Int32
Input width.
- srcHeight
-
Type: System.Int32
Input height.
- destWidth
-
Type: System.Int32 %
Width value you need to recalculate. This value may be changed depending on the mode argument value.
- destHeight
-
Type: System.Int32 %
Height value you need to recalculate. This value may be changed depending on the mode argument value.
- mode
-
Type: Aurigma.GraphicsMill.Transforms.ResizeMode
ResizeMode 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. 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:
- srcWidthWidth of the bitmap which you are going to resize.
- srcBitmapHeight of the bitmap which you are going to resize.
- destWidthAn integer variable which is equal to 640.
- destHeightAn integer variable which is equal to 480
- mode Fit
After you run this method, variables you pass as destWidth and destHeight will store recalculated dimensions.