Ellipse()

Syntax

Ellipse(x, y, RadiusX, RadiusY [, Color])
Description
Draw a filled ellipse at the position x,y with size of RadiusX and RadiusY. The current output is set with StartDrawing().

If the 'Color' parameter is not specified, the default color set with FrontColor() will be used. RGB() can be used to get a valid color value. A color table with common colors is available here.

Example:
  ; Several ellipses with random colors
  Width  = 220
  Height = 150
  If OpenWindow(0, 0, 0, Width, Height, "Ellipses", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
    If StartDrawing(WindowOutput(0))
      x = Width/2
      y = Height/2
      For radius=Height/2 To 10 Step -10
        Ellipse(x, y, radius*Width/Height, radius, RGB(Random(255),Random(255),Random(255)))
      Next radius
      StopDrawing() ; This is absolutely needed when the drawing operations are finished !!! Never forget it !
    EndIf
    
    Repeat : Event = WaitWindowEvent() : Until  Event = #PB_Event_CloseWindow
  EndIf

Supported OS

All

<- DrawingMode() - 2DDrawing Index - FillArea() ->