Skip to content

raylib.ImageDrawRectangle

JoeStrout edited this page Apr 29, 2026 · 2 revisions

Draw rectangle within an image

Parameters

Parameter Default Value Note
dst
posX 0
posY 0
width 256
height 256
color WHITE

Return value

None.

Notes

Example

img = raylib.GenImageColor(128, 128, raylib.BLACK)
// Draw a 32x32 red rectangle at (48, 48)
raylib.ImageDrawRectangle img, 48, 48, 32, 32, raylib.RED
raylib.ExportImage img, "rect.png"
raylib.UnloadImage img

Clone this wiki locally