bestfitrectangle
BOUNDARY
,
SOURCE
,
FINAL

The bestfitrectangle statement fits a rectangle within a boundary rectangle, enlarging or reducing as necessary to produce the best fit without changing the proportions.


Parameters

This statement has three parameters:

boundary – boundary rectangle.

source – original rectangle.

final – field or variable that will contain the adjusted rectangle.


Description

This statement fits a rectangle within a boundary rectangle, enlarging or reducing as necessary to produce the best fit without changing the proportions.

This example assumes that the current form contains an object named Photo. This code will modify the size of this object so that it is as big as possible within the window, but without changing the aspect ratio of the photo object.

local imageRect, adjustedImageRect
imageRect = objectinfo("Photo")
bestfitrectangle info("windowrectangle"),imageRect,adjustedImageRect
changeobject "Photo","rectangle",adjustedImageRect

See Also


History

VersionStatusNotes
10.0No ChangeCarried over from Panorama 6.0.