The rectanglesize( function defines a rectangle from its upper left hand corner and its width and height.
This function has four parameters:
top – is the position of the top edge of the rectangle. (Unlike standard cartesian co-ordinates, positive is down and negative is up.)
left – is the position of the left edge of the rectangle. (Like standard cartesian co-ordinates, positive is right and negative is left.)
height – is the height of the rectangle.
width – is the width of the rectangle.
The rectanglesize( function defines a rectangle by its upper left hand corner and its width and height. A rectangle is 32 bytes of raw binary data (see Binary Data, Graphic Coordinates). Panorama has many functions and statements that use rectangles for working with graphic elements.
The procedure below creates a rectangle that is 4 pixels high and 6 pixels wide.
Here is a magnified view of what this rectangle would look like if it was displayed on the screen:
adjustxy( -- adjusts the four corners of a rectangle. However, only corners
that are inside a boundary are adjusted. Corners outside the boundary are left alone.
bestfitrectangle -- fits a rectangle within a boundary rectangle, enlarging or reducing as necessary to produce the best fit without changing the proportions.
bestfitrectangle( -- fits a rectangle within a boundary rectangle, enlarging or reducing as necessary to produce the best fit without changing the proportions.
xytoxy( -- converts a point or rectangle from one co-ordinate system to another.
Unlike Panorama 6 and earlier, the parameters to this function are floating point values instead of integers (it will also accept integers). Also, the rectangle produced by this function is a 32 byte binary value, instead of an 8 byte text value.