Repository navigation
raylib.ImageDrawImagePro
JoeStrout edited this page Oct 17, 2026
·
1 revision
Draw a part of an image defined by a rectangle into destination rectangle, with scaling, within an image NOTE: origin and rotation are currently ignored by raylib
| Parameter | Default Value | Note |
|---|---|---|
| dst | ||
| src | ||
| srcRec | ||
| dstRec | ||
| origin | [0, 0] | |
| rotation | 0 | |
| tint | WHITE |
None.
Replaces ImageDraw, which was removed in raylib 6.2; with the default origin and rotation it behaves the same. The source rectangle is scaled to fit the destination rectangle.
In raylib 6.2, origin and rotation are accepted but ignored (not yet implemented upstream). To draw a rotated image, use ImageDrawImageEx.
dst = raylib.GenImageColor(128, 128, raylib.BLACK)
src = raylib.GenImageColor(32, 32, raylib.RED)
srcRec = [0, 0, 32, 32]
dstRec = [32, 32, 64, 64] // drawn at 2x size
raylib.ImageDrawImagePro dst, src, srcRec, dstRec
raylib.UnloadImage src
raylib.ExportImage dst, "composed.png"
raylib.UnloadImage dst