Rectangle
Overview
Rectangle is a class in Aspose.PDF FOSS for .NET.
Inherits from: Shape.
A rectangle shape in the Drawing namespace (distinct from Aspose.Pdf.Rectangle which is a page rectangle).
This class declares 3 methods for Rectangle objects in .NET programs.
Available methods include: CheckBounds, Rectangle.
Public members are accessible to any .NET application after installing the Aspose.PDF FOSS for .NET package.
Properties: Bottom, GraphInfo, Height, Left, RoundedCornerRadius, Text, and 1 more.
Properties
| Name | Type | Access | Description |
|---|---|---|---|
Left | double | Read/Write | Gets or sets the X coordinate of the left edge, in points relative to the graph. |
Bottom | double | Read/Write | Gets or sets the Y coordinate of the bottom edge, in points relative to the graph. |
Width | double | Read/Write | Gets or sets the width in points. |
Height | double | Read/Write | Gets or sets the height in points. |
RoundedCornerRadius | double | Read/Write | Corner radius for rounded-rectangle rendering (0 = sharp corners). |
GraphInfo | Aspose.Pdf.GraphInfo | Read/Write | Gets or sets the drawing settings (line width, stroke and fill colours, dash pattern, opacity) used to paint the shape. |
Text | Aspose.Pdf.Text.TextFragment? | Read/Write | Optional text label rendered with the shape. |
Methods
| Signature | Description |
|---|---|
Rectangle(left: double, bottom: double, width: double, height: double) | Creates a rectangle with its lower-left corner at (left, bottom) and the given width and height, in points relative to the graph. |
Rectangle(left: float, bottom: float, width: float, height: float) | Single-precision overload matching the public API. |
CheckBounds(containerWidth: double, containerHeight: double) | Whether the rectangle lies entirely within an origin-anchored container. |