Skip to main content

ImageRotate

ImageRotate (Statement)

Format

imagerotate image, radians

Description

Rotates an image held in memory by radians (see Radians to convert from degrees), in place. image is the identifier returned by ImageNew, ImageLoad, or ImageCopy.

The image is enlarged as needed so the rotated picture fits; the newly exposed corners are transparent. Whether the rotation is smoothed or hard-edged is controlled by ImageSmooth.

To draw a rotated copy without altering the stored image, use ImageCentered or ImageTransformed.

Example

a = imageload("sprite.png")
imagerotate a, radians(45)
imagedraw a, 100, 100

See Also

ImageAutoCrop, ImageCentered, ImageCopy, ImageCrop, ImageDraw, ImageFlip, ImageHeight, ImageLoad, ImageNew, ImagePixel, ImageResize, ImageRotate, ImageSetPixel, ImageSmooth, ImageTransformed, ImageWidth, Unload

Availability

BASIC-256 2.0 and later. Documented from the BASIC-256 v2.1 continuation project.