Image.copyImage

Copy pixels from another image onto this one.

This function does a slow pixel copy and should not be used intensively. It can be used to prepare a complex static image from several others, but if you need this kind of feature in real-time you'd better use RenderTexture.

If sourceRect is empty, the whole image is copied. If applyAlpha is set to true, the transparency of source pixels is applied. If it is false, the pixels are copied unchanged with their alpha value.

class Image
void
copyImage
(
const(Image) source
,
uint destX
,
uint destY
,
IntRect sourceRect = IntRect(0, 0, 0, 0)
,
bool applyAlpha = false
)

Parameters

source const(Image)

Source image to copy

destX uint

X coordinate of the destination position

destY uint

Y coordinate of the destination position

sourceRect IntRect

Sub-rectangle of the source image to copy

applyAlpha bool

Should the copy take the source transparency into account?

Meta