BorderSetRadius

Syntax

Success = BorderSetRadius(Border, TopLeftRx.d, TopLeftRy.d, TopRightRx.d, TopRightRy.d, BottomLeftRx.d, BottomLeftRy.d, BottomRightRx.d, BottomRightRy.d)

Description

Sets the horizontal (Rx) and vertical (Ry) radii for each corner of a generated border object, allowing for rounded or elliptical corners. This command is only applicable to borders created with CreateBorder().

Parameters

Border
The handle of the generated border object.

TopLeftRx.d
The horizontal radius (in DIPs) for the top-left corner.

TopLeftRy.d
The vertical radius (in DIPs) for the top-left corner.

TopRightRx.d
The horizontal radius (in DIPs) for the top-right corner.

TopRightRy.d
The vertical radius (in DIPs) for the top-right corner.

BottomLeftRx.d
The horizontal radius (in DIPs) for the bottom-left corner.

BottomLeftRy.d
The vertical radius (in DIPs) for the bottom-left corner.

BottomRightRx.d
The horizontal radius (in DIPs) for the bottom-right corner.

BottomRightRy.d
The vertical radius (in DIPs) for the bottom-right corner.

Note: Setting a radius to 0 results in a sharp corner.

Return Value

Returns #True if the radii were successfully set, or #False if the border handle is invalid or not a generated border.

Remarks

This function allows creating borders with different rounding for each corner. Setting corner radii invalidates the border's rendering cache and may change whether the border is considered "simple" (rectangular) for optimization purposes, unless the #PG_Border_NoMask flag is also set.

Example

IncludeFile "ProGUI_PB.pbi"

StartProGUI()

MyBorder = CreateBorder(#PG_Border_Solid, 5) ; Initially square corners

If MyBorder
  ; Set top corners rounded, bottom corners sharp
  If BorderSetRadius(MyBorder, 15, 15, 15, 15, 0, 0, 0, 0)
    Debug "Border radii updated successfully."
  EndIf
  FreeBorder(MyBorder)
EndIf

StopProGUI()

See Also

CreateBorder, BorderGetRadius, BorderSetWidth, BorderSetColor, BorderSetFlags

Supported OS

Windows, Linux