İlkel Olmayan Şekildeki Veriler

İlkel Olmayan Şekildeki Verilere Erişme

Bazen yerleşik olmayan bir şekildeki verilere erişmeniz gerekir. Yerleşik şekillere ilkel şekiller denir; olmayanlara ilkel olmayan denir. Örneğin, farklı eğri bağlantılı çizgiler kullanarak kendi şekillerinizi tanımlayabilirsiniz.

İlkel Olmayan Bir Şekil

Aspose.Cells’de, ilkel olmayan şekillere şu tür atanır:AutoShapeType.NotPrimitive . kullanarak türlerini kontrol edebilirsiniz.Shape.AutoShapeTypeEmlak.

kullanarak şekil verilerine erişin.Şekil.YollarEmlak. İlkel olmayan şekli oluşturan tüm bağlı yolları döndürür. Bu yollar şu türdendir:Şekil Yolubu, sırayla her segmentteki noktaları içeren tüm segmentlerin bir listesini tutar.

İlkel olmayan bir şekle örnek gösterir
yapılacaklar:resim_alternatif_metin
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-.NET
// The path to the documents directory.
string dataDir = RunExamples.GetDataDir(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
Workbook workbook = new Workbook(dataDir + "NonPrimitiveShape.xlsx");
Worksheet worksheet = workbook.Worksheets[0];
// Accessing the user defined shape
Shape shape = worksheet.Shapes[0];
if (shape.AutoShapeType == AutoShapeType.NotPrimitive)
{
// Access shape's data
ShapePathCollection shapePathCollection = shape.Paths;
// Access information of indvidual path
foreach (ShapePath shapePath in shapePathCollection)
{
// Access path segment list
ShapeSegmentPathCollection pathSegments = shapePath.PathSegementList;
// Access individual path segment
foreach (ShapeSegmentPath pathSegment in pathSegments)
{
// Gets the points in path segment
ShapePathPointCollection segmentPoints = pathSegment.Points;
foreach (ShapePathPoint pathPoint in segmentPoints)
{
Console.WriteLine("X: " + pathPoint.X + ", Y: " + pathPoint.Y);
}
}
}
}