ShapeCollection — Aspose.Slides FOSS for Java API Reference

Enumerations ShapeCollection class تمثل مجموعة الأشكال على شريحة. إنها تنفذ IShapeCollection و Iterable<IShape>.

Enumerations: org.aspose.slides.foss

import org.aspose.slides.foss.*;
public class ShapeCollection implements IShapeCollection, Iterable<IShape>

Enumerations

Enumerations

EnumerationsEnumerationsEnumerations
get(int index)IShapeاحصل على الشكل وفق فهرس يبدأ من الصفر.
size()intعدد الأشكال.
indexOf(IShape shape)intفهرس الشكل المعطى، أو -1.
iterator()Iterator<IShape>مكرّر عبر جميع الأشكال.

إضافة أشكال

EnumerationsEnumerationsEnumerations
addAutoShape(ShapeType, double x, double y, double w, double h)IAutoShapeأضف شكلاً تلقائيًا.
addAutoShape(ShapeType, double x, double y, double w, double h, boolean createFromTemplate)IAutoShapeأضف شكلاً تلقائيًا مع خيار القالب.
addConnector(ShapeType, double x, double y, double w, double h)IConnectorأضف شكل موصل.
addPictureFrame(ShapeType, double x, double y, double w, double h, IPPImage image)IPictureFrameأضف إطار صورة.
addTable(double x, double y, double[] colWidths, double[] rowHeights)ITableأضف جدولًا.

إدراج أشكال

EnumerationsEnumerationsEnumerations
insertAutoShape(int index, ShapeType, double x, double y, double w, double h)IAutoShapeأدرج شكلًا تلقائيًا في الفهرس المحدد.
insertConnector(int index, ShapeType, double x, double y, double w, double h)IConnectorأدرج موصلًا في الفهرس المحدد.
insertPictureFrame(int index, ShapeType, double x, double y, double w, double h, IPPImage image)IPictureFrameأدرج إطار صورة في الفهرس المحدد.
insertTable(int index, double x, double y, double[] colWidths, double[] rowHeights)ITableأدرج جدولًا في الفهرس المحدد.

Enumerations

EnumerationsEnumerationsEnumerations
reorderSingle(int newIndex, IShape shape)voidانقل شكلًا إلى موضع z-order جديد.

أمثلة الاستخدام

إضافة أشكال إلى شريحة

import org.aspose.slides.foss.*;

Presentation prs = new Presentation();
ISlide slide = prs.getSlides().get(0);
IShapeCollection shapes = slide.getShapes();

IAutoShape rect = shapes.addAutoShape(ShapeType.RECTANGLE, 50, 50, 200, 100);
rect.addTextFrame("Rectangle");

IAutoShape ellipse = shapes.addAutoShape(ShapeType.ELLIPSE, 300, 50, 100, 100);

System.out.println("Shape count: " + shapes.size());
prs.save("shapes.pptx", SaveFormat.PPTX);

إضافة جدول

double[] colWidths = {100, 100, 100};
double[] rowHeights = {30, 30, 30};
ITable table = slide.getShapes().addTable(50, 200, colWidths, rowHeights);

انظر أيضًا

 العربية