Image:paste

Copies a rectangle of pixels from one Image to this one.

Image:paste(source, x, y, fromX, fromY, width, height)

Arguments

NameTypeDefaultDescription
sourceImageThe Image to copy pixels from.
xnumber0The x coordinate to paste to (0-indexed).
ynumber0The y coordinate to paste to (0-indexed).
fromXnumber0The x coordinate in the source to paste from (0-indexed).
fromYnumber0The y coordinate in the source to paste from (0-indexed).
widthnumbersource:getWidth()The width of the region to copy.
heightnumbersource:getHeight()The height of the region to copy.

Returns

Nothing

Notes

The two Images must have the same pixel format.

Compressed images cannot be copied.

The rectangle cannot go outside the dimensions of the source or destination textures.

See also