Class ShapeGuideCollection
ShapeGuideCollection class
Encapsulates a collection of shape guide
public class ShapeGuideCollection : CollectionBase<ShapeGuide>
Constructors
Properties
Name | Description |
---|
Capacity { get; set; } | |
Count { get; } | |
Item { get; } | Gets a shape guide by index |
Item { get; set; } | |
Methods
Name | Description |
---|
Add(string, double) | Adds a shape guide.(Important: This feature is currently only available for Excel07 and above) |
BinarySearch(ShapeGuide) | |
BinarySearch(ShapeGuide, IComparer<ShapeGuide>) | |
BinarySearch(int, int, ShapeGuide, IComparer<ShapeGuide>) | |
Clear() | |
Contains(ShapeGuide) | |
CopyTo(ShapeGuide[]) | |
CopyTo(ShapeGuide[], int) | |
CopyTo(int, ShapeGuide[], int, int) | |
Exists(Predicate<ShapeGuide>) | |
Find(Predicate<ShapeGuide>) | |
FindAll(Predicate<ShapeGuide>) | |
FindIndex(Predicate<ShapeGuide>) | |
FindIndex(int, Predicate<ShapeGuide>) | |
FindIndex(int, int, Predicate<ShapeGuide>) | |
FindLast(Predicate<ShapeGuide>) | |
FindLastIndex(Predicate<ShapeGuide>) | |
FindLastIndex(int, Predicate<ShapeGuide>) | |
FindLastIndex(int, int, Predicate<ShapeGuide>) | |
GetEnumerator() | |
IndexOf(ShapeGuide) | |
IndexOf(ShapeGuide, int) | |
IndexOf(ShapeGuide, int, int) | |
LastIndexOf(ShapeGuide) | |
LastIndexOf(ShapeGuide, int) | |
LastIndexOf(ShapeGuide, int, int) | |
RemoveAt(int) | |
Examples
namespace AsposeCellsExamples
{
using Aspose.Cells;
using Aspose.Cells.Drawing;
using System;
public class DrawingClassShapeGuideCollectionDemo
{
public static void Run()
{
// Create a new workbook
Workbook workbook = new Workbook();
Worksheet worksheet = workbook.Worksheets[0];
// Add a custom shape using valid MsoDrawingType and set its type to Rectangle
Shape shape = worksheet.Shapes.AddShape(MsoDrawingType.Rectangle, 10, 10, 0, 0, 200, 100);
shape.AutoShapeType = AutoShapeType.Rectangle;
// Get the ShapeGuideCollection from the shape's geometry adjustments
ShapeGuideCollection shapeGuides = shape.Geometry.ShapeAdjustValues;
// Add new shape guides with names and values
shapeGuides.Add("Guide1", 0.2);
shapeGuides.Add("Guide2", 0.5);
shapeGuides.Add("Guide3", 0.8);
// Retrieve and display the first guide's value
ShapeGuide firstGuide = shapeGuides[0];
Console.WriteLine($"First guide value: {firstGuide.Value}");
// Save the workbook
workbook.Save("ShapeGuideCollectionDemo.xlsx");
}
}
}
See Also