Leadtools Send comments on this topic. | Back to Introduction - All Topics | Help Version 15.3.5
CalculatePaintModeRectangle Method
See Also 
Leadtools Namespace > RasterImage Class : CalculatePaintModeRectangle Method




sourceWidth
The width of the source rectangle.
sourceHeight
The height of the source rectangle.
destinationRectangle
Destination rectangle.
sizeMode
Controls how the source rectangle is positioned inside the destination rectangle.
horizontalAlignMode
Controls how the source rectangle is aligned horizontally inside the destination rectangle.
verticalAlignMode
Controls how the source rectangle is aligned vertically inside the destination rectangle.
Adjusts the given rectangle based on the given paint mode properties.

Syntax

Visual Basic (Declaration) 
Public Shared Function CalculatePaintModeRectangle( _
   ByVal sourceWidth As Integer, _
   ByVal sourceHeight As Integer, _
   ByVal destinationRectangle As Rectangle, _
   ByVal sizeMode As RasterPaintSizeMode, _
   ByVal horizontalAlignMode As RasterPaintAlignMode, _
   ByVal verticalAlignMode As RasterPaintAlignMode _
) As Rectangle
Visual Basic (Usage)Copy Code
Dim sourceWidth As Integer
Dim sourceHeight As Integer
Dim destinationRectangle As Rectangle
Dim sizeMode As RasterPaintSizeMode
Dim horizontalAlignMode As RasterPaintAlignMode
Dim verticalAlignMode As RasterPaintAlignMode
Dim value As Rectangle
 
value = RasterImage.CalculatePaintModeRectangle(sourceWidth, sourceHeight, destinationRectangle, sizeMode, horizontalAlignMode, verticalAlignMode)
Managed Extensions for C++ 
public: static Rectangle CalculatePaintModeRectangle( 
   int sourceWidth,
   int sourceHeight,
   Rectangle destinationRectangle,
   RasterPaintSizeMode sizeMode,
   RasterPaintAlignMode horizontalAlignMode,
   RasterPaintAlignMode verticalAlignMode
) 

Parameters

sourceWidth
The width of the source rectangle.
sourceHeight
The height of the source rectangle.
destinationRectangle
Destination rectangle.
sizeMode
Controls how the source rectangle is positioned inside the destination rectangle.
horizontalAlignMode
Controls how the source rectangle is aligned horizontally inside the destination rectangle.
verticalAlignMode
Controls how the source rectangle is aligned vertically inside the destination rectangle.

Return Value

The new destination rectangle adjusted based on the size mode and alignment.

Remarks

This method allows you to calculate how a source rectangle can be adjusted into a destination rectangle based on a size mode and alignment.

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