Adjusts the given rectangle based on the given paint mode properties.
public static LeadRect CalculatePaintModeRectangle(
int sourceWidth,
int sourceHeight,
LeadRect destinationRectangle,
RasterPaintSizeMode sizeMode,
RasterPaintAlignMode horizontalAlignMode,
RasterPaintAlignMode verticalAlignMode
)
Public Shared Function CalculatePaintModeRectangle( _
ByVal sourceWidth As Integer, _
ByVal sourceHeight As Integer, _
ByVal destinationRectangle As LeadRect, _
ByVal sizeMode As RasterPaintSizeMode, _
ByVal horizontalAlignMode As RasterPaintAlignMode, _
ByVal verticalAlignMode As RasterPaintAlignMode _
) As LeadRect
+ (LeadRect)calculatePaintModeRectangle:(NSInteger)sourceWidth
sourceHeight:(NSInteger)sourceHeight
destinationRectangle:(LeadRect)dstRect
sizeMode:(LTRasterPaintSizeMode)sizeMode
horizontalAlignMode:(LTRasterPaintAlignMode)horizontalAlignMode
verticalAlignMode:(LTRasterPaintAlignMode)verticalAlignMode
public static LeadRect calculatePaintModeRectangle(
int sourceWidth,
int sourceHeight,
LeadRect destinationRectangle,
RasterPaintSizeMode sizeMode,
RasterPaintAlignMode horizontalAlignMode,
RasterPaintAlignMode verticalAlignMode
)
public:
static LeadRect CalculatePaintModeRectangle(
int sourceWidth,
int sourceHeight,
LeadRect destinationRectangle,
RasterPaintSizeMode sizeMode,
RasterPaintAlignMode horizontalAlignMode,
RasterPaintAlignMode verticalAlignMode
)
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.
The new destination rectangle adjusted based on the size mode and alignment.
This method allows you to calculate how a source rectangle can be adjusted into a destination rectangle based on a size mode and alignment.
using Leadtools;
using Leadtools.Codecs;
using Leadtools.ImageProcessing;
using Leadtools.ImageProcessing.Core;
using Leadtools.ImageProcessing.Color;
using Leadtools.Dicom;
using Leadtools.Drawing;
using Leadtools.Controls;
using LeadtoolsExamples.Common;
using Leadtools.Svg;
public void CalculatePaintModeRectangleExample()
{
// assume image width/height of 3000 x 1000
// assume client rectangle of 500 x 500
LeadRect client = new LeadRect(0, 0, 500, 500);
LeadRect fit = RasterImage.CalculatePaintModeRectangle(3000, 1000, client, RasterPaintSizeMode.Fit, RasterPaintAlignMode.Near, RasterPaintAlignMode.Near);
Console.WriteLine("{0},{1},{2},{3}", fit.Left, fit.Top, fit.Right, fit.Bottom);
}
Imports Leadtools
Imports Leadtools.Codecs
Imports Leadtools.ImageProcessing
Imports Leadtools.ImageProcessing.Core
Imports Leadtools.ImageProcessing.Color
Imports Leadtools.Controls
Imports Leadtools.Dicom
Imports Leadtools.Drawing
Imports Leadtools.Svg
Public Sub CalculatePaintModeRectangleExample()
' assume image width/height of 3000 x 1000
' assume client rectangle of 500 x 500
Dim client As LeadRect = New LeadRect(0, 0, 500, 500)
Dim fit As LeadRect = RasterImage.CalculatePaintModeRectangle(3000, 1000, client, RasterPaintSizeMode.Fit, RasterPaintAlignMode.Near,
RasterPaintAlignMode.Near)
Console.WriteLine("{0},{1},{2},{3}", fit.Left, fit.Top, fit.Right, fit.Bottom)
End Sub
Help Collections
Raster .NET | C API | C++ Class Library | HTML5 JavaScript
Document .NET | C API | C++ Class Library | HTML5 JavaScript
Medical .NET | C API | C++ Class Library | HTML5 JavaScript
Medical Web Viewer .NET
Multimedia
Direct Show .NET | C API | Filters
Media Foundation .NET | C API | Transforms
Supported Platforms
.NET, Java, Android, and iOS/macOS Assemblies
Imaging, Medical, and Document
C API/C++ Class Libraries
Imaging, Medical, and Document
HTML5 JavaScript Libraries
Imaging, Medical, and Document