DrawEllipseFill

Syntax

DrawEllipseFill(x.d, y.d, RadiusX.d, RadiusY.d, Brush)

Description

Draws a filled ellipse (or circle if radii are equal) centered at the specified coordinates using the provided brush.

Parameters

x.d
The horizontal coordinate of the ellipse's center in device-independent pixels (DIPs).

y.d
The vertical coordinate of the ellipse's center in DIPs.

RadiusX.d
The horizontal radius of the ellipse in DIPs.

RadiusY.d
The vertical radius of the ellipse in DIPs.

Brush
The handle of the brush (created with CreateBrushImg(), CreateBrushGradientLinear(), etc.) used to fill the ellipse.

Return Value

This command does not return a value. It returns internally if the Brush handle is invalid, or if RadiusX or RadiusY are zero or less.

Remarks

The coordinates and radii are specified in DIPs but are converted internally to physical pixels based on the current output's DPI before drawing. The appearance of the fill depends on the brush type (image, gradient) and its properties (position, scale, rotation, extend mode, opacity).

Example

IncludeFile "ProGUI_PB.pbi"

StartProGUI()

; Create a gradient brush for the fill
Global GradientBrush = CreateBrushGradientLinear(0, 0, 150, 0, RGB(255, 0, 0), 1, RGB(0, 0, 255), 1) ; Red to Blue

Procedure DrawHandler(Window, EventType, *EventData.PG_EventDraw, *UserData)
  
    DrawClear(RGB(255, 255, 255), 1) ; White background

    ; Draw an ellipse filled using the gradient brush
    DrawEllipseFill(150, 100, 100, 60, GradientBrush)

EndProcedure

MyWindow = CreateWindow(0, 0, 300, 200, "DrawEllipseFill Example")

If MyWindow
  AddEventHandler(MyWindow, #PG_Event_Draw, @DrawHandler())
  WindowShow(MyWindow, #True, #PG_WindowShow_ScreenCentered)

  Repeat
    Event = WaitWindowEvent()
  Until Event = #PB_Event_CloseWindow
EndIf

FreeBrush(GradientBrush)
StopProGUI()

See Also

DrawEllipse, DrawEllipseStrokeFill, CreateBrushImg, CreateBrushGradientLinear, CreateBrushGradientRadial, BeginDraw, EndDraw

Supported OS

Windows, Linux