New to Telerik UI for WinForms? Start a free 30-day trial

Represents the base class for element shapes that define the visual geometry of UI elements.

Provides the foundation for specialized shapes such as EllipseShape, RoundRectShape, and Office12Shape. Derived classes implement specific shape creation logic while this base class handles common functionality like bounds calculation, region creation, and RTL support.

Definition

Constructors

C#
public ElementShape()
C#
public ElementShape(IContainer container)
Parameters:containerIContainer

Properties

Gets or sets a value indicating whether the shape should be rendered for right-to-left layouts.

C#
public bool IsRightToLeft { get; set; }
Property Value:

true if the shape supports right-to-left rendering; otherwise, false.

Methods

C#
protected virtual GraphicsPath CreateContour(Rectangle bounds)
Parameters:boundsRectangleReturns:

GraphicsPath

Creates a GraphicsPath using the specified rectangle as bounds. This method must be implemented by derived classes.

C#
public abstract GraphicsPath CreatePath(Rectangle bounds)
Parameters:boundsRectangle

The rectangle defining the bounds for the shape.

Returns:

GraphicsPath

A GraphicsPath representing the shape within the specified bounds.

Creates a GraphicsPath using the specified rectangle as bounds with floating-point precision.

C#
public virtual GraphicsPath CreatePath(RectangleF bounds)
Parameters:boundsRectangleF

The rectangle defining the bounds for the shape.

Returns:

GraphicsPath

A GraphicsPath representing the shape within the specified bounds.

C#
public virtual Region CreateRegion(Rectangle bounds)
Parameters:boundsRectangleReturns:

Region

Deserializes properties. Required for the deserialization mechanism of telerik framework.

C#
public virtual void DeserializeProperties(string propertiesString)
Parameters:propertiesStringstring
C#
protected override void Dispose(bool disposing)
Parameters:disposingbool

Overrides: Component.Dispose(bool)

C#
protected virtual Rectangle GetBounds(RadElement element)
Parameters:elementRadElementReturns:

Rectangle

Retrieves the contour path for the specified element.

C#
public GraphicsPath GetElementContour(RadElement element)
Parameters:elementRadElement

The element for which to create the contour.

Returns:

GraphicsPath

A GraphicsPath representing the element's contour.

The contour typically represents the outline or border of the element's shape.

C#
public GraphicsPath GetElementContour(Rectangle bounds)
Parameters:boundsRectangleReturns:

GraphicsPath

Retrieves the shape path for the specified element.

C#
public GraphicsPath GetElementShape(RadElement element)
Parameters:elementRadElement

The element for which to create the shape.

Returns:

GraphicsPath

A GraphicsPath representing the element's shape.

The GraphicsPath represents a series of connected lines and curves that define the element's geometry.

Mirrors the GraphicsPath. Used in RightToLeft mode.

C#
protected virtual void MirrorPath(GraphicsPath graphicsPath, RectangleF bounds)
Parameters:graphicsPathGraphicsPathboundsRectangleF

Serializes properties. Required for serialization mechanism of telerik framework.

C#
public virtual string SerializeProperties()
Returns:

string

C#
protected virtual bool ShouldMirrorPath()
Returns:

bool