Leadtools.WinForms Send comments on this topic. | Back to Introduction - All Topics | Help Version 15.8.31
GetFixedAspectRatioImageRectangle Method
See Also 
Leadtools.WinForms Namespace > RasterImageList Class : GetFixedAspectRatioImageRectangle Method




imageWidth
Width of the image in pixels
imageHeight
Height of the image in pixels
imageRect
The source rectangle
Calculates how an image is to be sized and positioned in a rectangle while keeping the aspect ratio fixed.

Syntax

Visual Basic (Declaration) 
Public Shared Function GetFixedAspectRatioImageRectangle( _
   ByVal imageWidth As Integer, _
   ByVal imageHeight As Integer, _
   ByVal imageRect As Rectangle _
) As Rectangle
Visual Basic (Usage)Copy Code
Dim imageWidth As Integer
Dim imageHeight As Integer
Dim imageRect As Rectangle
Dim value As Rectangle
 
value = RasterImageList.GetFixedAspectRatioImageRectangle(imageWidth, imageHeight, imageRect)
C# 
public static Rectangle GetFixedAspectRatioImageRectangle( 
   int imageWidth,
   int imageHeight,
   Rectangle imageRect
)
Managed Extensions for C++ 
public: static Rectangle GetFixedAspectRatioImageRectangle( 
   int imageWidth,
   int imageHeight,
   Rectangle imageRect
) 
C++/CLI 
public:
static Rectangle GetFixedAspectRatioImageRectangle( 
   int imageWidth,
   int imageHeight,
   Rectangle imageRect
) 

Parameters

imageWidth
Width of the image in pixels
imageHeight
Height of the image in pixels
imageRect
The source rectangle

Return Value

A Rectangle structure that specifies where the image is to be positioned and sized in imageRect while keeping the aspect ratio fixed.

Example

For an example, refer to DrawItem.

Remarks

When the RasterImageList class draws an item image, it tries to fit the image into the item image rectangle while maintaining the aspect ratio. The control internally calls this method to calculate these values.

Requirements

Target Platforms: Microsoft .NET Framework 2.0, Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

See Also