LEADTOOLS Windows Forms (Leadtools.WinForms assembly)
LEAD Technologies, Inc

GetFixedAspectRatioImageRectangle Method






Width of the image in pixels
Height of the image in pixels
The source rectangle
Calculates how an image is to be sized and positioned in a rectangle while keeping the aspect ratio fixed.
Syntax
public static Rectangle GetFixedAspectRatioImageRectangle( 
   int imageWidth,
   int imageHeight,
   Rectangle imageRect
)
'Declaration
 
Public Shared Function GetFixedAspectRatioImageRectangle( _
   ByVal imageWidth As Integer, _
   ByVal imageHeight As Integer, _
   ByVal imageRect As Rectangle _
) As Rectangle
'Usage
 
Dim imageWidth As Integer
Dim imageHeight As Integer
Dim imageRect As Rectangle
Dim value As Rectangle
 
value = RasterImageList.GetFixedAspectRatioImageRectangle(imageWidth, imageHeight, imageRect)
public static Rectangle GetFixedAspectRatioImageRectangle( 
   int imageWidth,
   int imageHeight,
   Rectangle imageRect
)
 function Leadtools.WinForms.RasterImageList.GetFixedAspectRatioImageRectangle( 
   imageWidth ,
   imageHeight ,
   imageRect 
)
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 System.Drawing.Rectangle structure that specifies where the image is to be positioned and sized in imageRect while keeping the aspect ratio fixed.
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.
Example
For an example, refer to DrawItem.
Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

Reference

RasterImageList Class
RasterImageList Members

 

 


Products | Support | Contact Us | Copyright Notices

© 2006-2012 All Rights Reserved. LEAD Technologies, Inc.