Skip to content

raylib.ImageResizeCanvas

JoeStrout edited this page Apr 29, 2026 · 2 revisions

Resize canvas and fill with color NOTE: Resize offset is relative to the top-left corner of the original image

Parameters

Parameter Default Value Note
image
offsetX
offsetY
newWidth
newHeight
fill

Return value

None.

Notes

Example

img = raylib.LoadImage("sprite.png")
// Add a 16px border of black around the image
raylib.ImageResizeCanvas img, img.width + 32, img.height + 32, 16, 16, raylib.BLACK
raylib.ExportImage img, "sprite_bordered.png"
raylib.UnloadImage img

Clone this wiki locally