Ellipse |
Bitmaps | |
| Aptilis 1 | ||
Ellipse(BitmapHandle, xCenter, yCenter, aRadius, bRadius, Colour)
Ellipse will draw ellipses(ovals) and circles.
You need to specify a center, (xCenter, yCenter)
and two radiuses. aRadius is the horizontal radius and
bRadius is the vertical one.
The trick to draw circles is to use identical values
for aRadius and bRadius.
Return Value:
0 if everything was OK or -1 if you indicated a non-valid bitmap.
Example:
b = createBitmap(250, 100)
if b = -1
print("Ooops, could not create the bitmap....\n")
else
// black background
clearBitmap(b, RGB(0, 0, 0))
// The green oval
ellipse(b, 40, 40, 30, 10, RGB(0, 255, 0))
// The red circle
ellipse(b, 125, 50, 40, 40, RGB(255, 0, 0))
// The Magenta oval
ellipse(b, 200, 50, 10, 40, RGB(255, 0, 255))
saveGIFFile("ellipse.gif", b)
end if
Result:
![]() |
For more details see the Bitmap topic.
