Box

Bitmaps
Aptilis 1

Box(BitmapHandle, x1, y1, x2, y2, Colour, Fill)

Box allows you to draw a box from (including) (x1, y1) to (including)(x2, y2).
The colour is specified through its index.
The 'Fill' parameter indicates if you only want the frame of the box (ie. a rectangle) or if you want it to be filled as well. Any non-zero value for 'Fill' will make full boxes.

Return Value:
0 if everything was OK or -1 if you indicated a non-valid bitmap.

Example:

b = createBitmap(200, 100)
if b = -1
print("Ooops, could not create the bitmap....\n")
else

// White background
clearBitmap(b, RGB(255, 255, 255))

// The filled red box
box(b, 10, 10, 60, 30, RGB(255, 0, 0), 1)

// The green box
box(b, 4, 70, 180, 95, RGB(0, 255, 0), 0)

saveGIFFile("box.gif", b)

end if
Result:

For more details see the Bitmap topic.