Skip to content

raylib.ImageDrawLine

JoeStrout edited this page Apr 29, 2026 · 2 revisions

Draw line within an image

Parameters

Parameter Default Value Note
dst
startPosX 0
startPosY 0
endPosX 0
endPosY 0
color WHITE

Return value

None.

Notes

Example

img = raylib.GenImageColor(128, 128, raylib.BLACK)
// Draw a diagonal line from top-left to bottom-right
raylib.ImageDrawLine img, 0, 0, 127, 127, raylib.WHITE
raylib.ExportImage img, "line.png"
raylib.UnloadImage img

Clone this wiki locally