Floating objects are Drawing Shapes, Images and Charts. All floating objects displayed on worksheet inherited from FloatingObject
class.
Inheritance Hierarchy
- FloatingObject
- DrawingObject
- ShapeObject
- RectangleShape
- EllipseShape
- RoundedRectangleShape
- PieShape
- DiamondShape
- Line
- ImageObject
- DrawingComponent
- ShapeObject
- DrawingObject
Create Floating Object
The following code creates a rectangle object:
var rectObj = new Drawing.Shapes.RectangleShape() { // set the location of rectangle Location = new Graphics.Point(50, 50), // set the size of rectangle Size = new Graphics.Size(200, 100), };
Add Floating Object
To add a floating object onto worksheet, put the object into the collection FloatingObjects
of worksheet:
// get current selected worksheet var worksheet = control.CurrentWorksheet; // adding rectangle on worksheet worksheet.FloatingObjects.Add(rectObj);
Result:
Floating Image
To add an images on worksheet, see Floating Image.
See Also
- Floating Image
- Drawing
- Basic Shapes
- Rectangle
- Ellipse
- Connections
- Line
- Smart Shapes
- Rounded Rectangle
- Basic Shapes
- Chart