DrawEllipseStrokeFill

Syntax

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

Description

Draws the outline (stroke) of an ellipse (or circle if radii are equal) centered at the specified coordinates using the provided brush. The appearance of the stroke (width, dash style, caps) is determined by the current stroke settings defined by DrawSetStroke().

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 draw the outline.

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. Use DrawSetStroke() before calling this function to customize the line's appearance (note: corner styles like Bevel or Round have no effect on ellipses). The appearance of the stroke 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 stroke
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

    ; Set stroke to 8px wide
    DrawSetStroke(8)
    ; Draw an ellipse outline using the gradient brush
    DrawEllipseStrokeFill(150, 100, 100, 60, GradientBrush)

    ; Restore default stroke
    DrawSetStroke(1)

EndProcedure

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

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

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

FreeBrush(GradientBrush)
StopProGUI()

See Also

DrawSetStroke, DrawEllipseStroke, DrawEllipseFill, DrawBoxStrokeFill, CreateBrushImg, CreateBrushGradientLinear, BeginDraw, EndDraw

Supported OS

Windows, Linux