Skip to content

raylib.ImageDrawImageRec

JoeStrout edited this page Oct 17, 2026 · 1 revision

Draw a part of an image defined by a rectangle within an image

Parameters

Parameter Default Value Note
dst
src
srcRec
position [0, 0]
tint WHITE

Return value

None.

Notes

Draws only the srcRec portion of src, at its original size.

Example

dst = raylib.GenImageColor(128, 128, raylib.BLACK)
sheet = raylib.LoadImage("assets/digits.png")
// Copy one 16x16 cell from a sprite sheet
raylib.ImageDrawImageRec dst, sheet, [16, 0, 16, 16], [10, 10]
raylib.UnloadImage sheet
raylib.UnloadImage dst

Clone this wiki locally