Commands:Scaletofit

The command scales the element (preserving aspect) to fit inside a box. If you want to scale the element so that it fits snugly around a box, see.

Usage
scaletofit,left,top,right,bottom The parameters left, top, right, and bottom define the rectangle to fit the element into. To mirror the image horizontally, swap the left and right parameters. To mirror the image vertically, swap the top and bottom parameters.

The element will be aligned according to its and  settings. For example, if  is in effect, then the left edge of the element will be aligned with the left edge of the box.

Examples
To scale the element to fit inside the bottom-left quarter of the screen:

scaletofit,0,SCREEN_HEIGHT/2,SCREEN_WIDTH/2,SCREEN_HEIGHT

To mirror the image vertically and fit it into a 100px square box at (200, 500):

scaletofit,200,600,300,500