Skip to content

raylib.ImageDrawRectanglePro

JoeStrout edited this page Oct 17, 2026 · 1 revision

Draw a color-filled rectangle with pro parameters within and image

Parameters

Parameter Default Value Note
dst
rec
origin [0, 0]
rotation 0
color WHITE

Return value

None.

Notes

rotation is in degrees around the pivot point rec.x + origin.x, rec.y + origin.y. Note: this differs from DrawRectanglePro, where the pivot is at rec.x, rec.y and the rectangle is offset by origin.

Example

img = raylib.GenImageColor(128, 128, raylib.BLACK)
// A 60x10 bar rotated 30 degrees about its center
raylib.ImageDrawRectanglePro img, [34, 59, 60, 10], [30, 5], 30, raylib.WHITE
raylib.ExportImage img, "bar.png"
raylib.UnloadImage img

Clone this wiki locally