Skip to main content

ImageTransformed

ImageTransformed (Statement)

Format

imagetransformed image, x1, y1, x2, y2, x3, y3, x4, y4
imagetransformed image, x1, y1, x2, y2, x3, y3, x4, y4, opacity

Description

Draws an image held in memory onto the graphics output, warped so that its four corners are mapped to the four points you supply. This lets you skew an image into any quadrilateral — for perspective effects, projected walls, and so on. The stored image is not changed.

The corner points are given in this order:

  1. (x1, y1) — top-left corner of the image
  2. (x2, y2) — top-right corner
  3. (x3, y3) — bottom-right corner
  4. (x4, y4) — bottom-left corner

opacity ranges from 0.0 (invisible) to 1.0 (opaque) and defaults to 1.0. Smoothing follows ImageSmooth.

Example

a = imageload("poster.png")
# lean the poster into the distance
imagetransformed a, 50, 20, 250, 60, 260, 220, 40, 200

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.