Fits this rectangle inside a containing rectangle, preserving aspect ratio.

The size is determined by the fit type. You can choose to map the width of this rectangle into the width of the destination, or the height into the height of the destination, or both. The rectangle will be centered inside the containing rectangle.

Syntax

[C#]

static Rectangle FitIn(Rectangle container, Rectangle contained, FitType fit);

[Visual Basic]

Shared Function FitIn(container As Rectangle, contained As Rectangle, fit As FitType) As Rectangle
Params
Name Description
container The rectangle into which to fit the contained rectangle.
contained The rectangle which should be contained.
fit The type of fit to apply.
return The resultant rectangle.
Notes

None.

Example

None.