TRANSFORM is a drawing tool for making floating selections and it is capable of applying affine or perspective transformation to floating selection.
If ordinary selection exists when switching to the TRANSFORM tool, the selection is transformed to a floating selection.
TRANSFORM is one of the few tools capable of handling floating selections and the raster editor switches to this tool (if it is configured so) when image is pasted or dragged and dropped over the editor. Also, this tool handles the Select all (Ctrl+A) command.
To crop an image with this tool:
TRANSFORM tool can be used from scripts. The command in script must have 2, 5, 6, 8, 9, or 12 parameters:
if the command has 6, 9, or 12 parameters, the first four define the affected rectangle. In other cases, the whole image is affected.
In case of 2 (or 6) parameters, the offset is given.
In case of 5 (or 9) parameters, the offset, scale, and rotation angle in degrees is given.
In case of 8 (or 12) parameters, pairs of number define corners or a quadrangle for perspective transformation.
// scale the entire image to half and rotate it by 45 degrees
DrawTool.TRANSFORM(Document, 0, 0, 0.5, 0.5, 45);
See also: DrawTool object, Document object