Figure

Inheritance: java.lang.Object, com.aspose.imaging.ObjectWithBounds

public class Figure extends ObjectWithBounds

الشكل. حاوية للأشكال.

المنشئات

المنشئالوصف
Figure()ينشئ مثيلًا جديدًا من Figure.

الطرق

طريقةالوصف
getShapes()يسترجع أشكال الشكل.
getBounds()يحصل أو يضبط حدود الكائن.
isClosed()يحصل على قيمة تشير إلى ما إذا كان هذا الشكل مغلقًا.
setClosed(boolean value)يضبط قيمة تشير إلى ما إذا كان هذا الشكل مغلقًا.
getSegments()يحصل على جميع مقاطع الشكل.
addShape(Shape shape)يضيف شكلاً إلى الشكل.
addShapes(Shape[] shapes)يضيف مجموعة من الأشكال إلى الشكل.
removeShape(Shape shape)يزيل شكلاً من الشكل.
removeShapes(Shape[] shapes)يزيل مجموعة من الأشكال من الشكل.
reverse()يعكس ترتيب أشكال هذا الشكل وترتيب نقاط الأشكال.
getBounds(Matrix matrix)يحصل على حدود الكائن.
getBounds(Matrix matrix, Pen pen)يحصل على حدود الكائن.
transform(Matrix transform)يطبق التحويل المحدد على الشكل.
equals(Object obj)يحدد ما إذا كان الكائن المحدد مساويًا للكائن الحالي.
hashCode()يعمل كدالة التجزئة الافتراضية.

Example: This examples make use of GraphicsPath and Graphics class to create and manipulate Figures on an Image surface.

تستخدم هذه الأمثلة فئة GraphicsPath وفئة Graphics لإنشاء وتعديل الأشكال على سطح صورة. ينشئ المثال صورة جديدة (من نوع Tiff) ويرسم المسارات بمساعدة فئة GraphicsPath. في النهاية يتم استدعاء طريقة DrawPath التي توفرها فئة Graphics لعرض المسارات على السطح.

// إنشاء نسخة من FileStream
com.aspose.imaging.system.io.FileStream stream = new com.aspose.imaging.system.io.FileStream("C:\\temp\\output.tif", com.aspose.imaging.system.io.FileMode.Create);
try {
    // إنشاء نسخة من TiffOptions وتعيين خصائصه المتنوعة
    com.aspose.imaging.imageoptions.TiffOptions tiffOptions = new com.aspose.imaging.imageoptions.TiffOptions(com.aspose.imaging.fileformats.tiff.enums.TiffExpectedFormat.Default);

    // تعيين المصدر لنسخة ImageOptions
    tiffOptions.setSource(new com.aspose.imaging.sources.StreamSource(stream));

    // إنشاء نسخة من Image
    com.aspose.imaging.Image image = com.aspose.imaging.Image.create(tiffOptions, 500, 500);
    try {
        // إنشاء وتهيئة نسخة من فئة Graphics
        com.aspose.imaging.Graphics graphics = new com.aspose.imaging.Graphics(image);

        // مسح سطح Graphics
        graphics.clear(com.aspose.imaging.Color.getWheat());

        // إنشاء نسخة من فئة GraphicsPath
        com.aspose.imaging.GraphicsPath graphicspath = new com.aspose.imaging.GraphicsPath();

        // إنشاء نسخة من فئة Figure
        com.aspose.imaging.Figure figure = new com.aspose.imaging.Figure();

        // إضافة أشكال إلى كائن Figure
        figure.addShape(new com.aspose.imaging.shapes.RectangleShape(new com.aspose.imaging.RectangleF(10, 10, 300, 300)));
        figure.addShape(new com.aspose.imaging.shapes.EllipseShape(new com.aspose.imaging.RectangleF(50, 50, 300, 300)));
        figure.addShape(
                new com.aspose.imaging.shapes.PieShape(new com.aspose.imaging.RectangleF(
                        new com.aspose.imaging.PointF(250, 250),
                        new com.aspose.imaging.SizeF(200, 200)),
                        0, 45));

        // إضافة كائن Figure إلى GraphicsPath
        graphicspath.addFigure(figure);

        // رسم مسار باستخدام كائن Pen باللون الأسود
        graphics.drawPath(new com.aspose.imaging.Pen(com.aspose.imaging.Color.getBlack(), 2), graphicspath);

        // حفظ جميع التغييرات.
        image.save();
    } finally {
        image.dispose();
    }
} finally {
    stream.dispose();
}

Figure()

public Figure()

يُهيئ نسخة جديدة من Figure. مُنشئ مطلوب لتسلسل JSON.

getShapes()

public Shape[] getShapes()

يسترجع أشكال الشكل.

Returns: com.aspose.imaging.Shape[] - أشكال الشكل.

getBounds()

public RectangleF getBounds()

يحصل أو يضبط حدود الكائن.

Returns: RectangleF - The object’s bounds.

isClosed()

public boolean isClosed()

يحصل على قيمة تشير إلى ما إذا كان هذا الشكل مغلقًا. سيُحدث الشكل المغلق فرقًا فقط في الحالة التي تكون فيها الأشكال الأولى والأخيرة للشكل متصلة. في هذه الحالة سيتم ربط النقطة الأولى للشكل الأول بخط مستقيم من النقطة الأخيرة للشكل الأخير.

Returns: منطقي - True إذا كان هذا الشكل مغلقًا؛ وإلا false.

setClosed(boolean value)

public void setClosed(boolean value)

يضبط قيمة تشير إلى ما إذا كان هذا الشكل مغلقًا. سيُحدث الشكل المغلق فرقًا فقط في الحالة التي تكون فيها الأشكال الأولى والأخيرة للشكل متصلة. في هذه الحالة سيتم ربط النقطة الأولى للشكل الأول بخط مستقيم من النقطة الأخيرة للشكل الأخير.

Parameters:

معاملنوعالوصف
valuebooleanTrue إذا كان هذا الشكل مغلقًا؛ وإلا false.

getSegments()

public ShapeSegment[] getSegments()

يحصل على جميع مقاطع الشكل.

Returns: com.aspose.imaging.ShapeSegment[] - مقاطع الشكل.

addShape(Shape shape)

public void addShape(Shape shape)

يضيف شكلاً إلى الشكل.

Parameters:

معاملنوعالوصف
shapeShapeالشكل للإضافة.

Example: This examples make use of GraphicsPath and Graphics class to create and manipulate Figures on an Image surface. تستخدم هذه الأمثلة فئة GraphicsPath وفئة Graphics لإنشاء وتعديل الأشكال على سطح صورة. ينشئ المثال صورة جديدة (من نوع Tiff) ويرسم المسارات بمساعدة فئة GraphicsPath. في النهاية يتم استدعاء طريقة DrawPath التي توفرها فئة Graphics لعرض المسارات على السطح.

// إنشاء نسخة من FileStream
com.aspose.imaging.system.io.FileStream stream = new com.aspose.imaging.system.io.FileStream("C:\\temp\\output.tif", com.aspose.imaging.system.io.FileMode.Create);
try {
    // إنشاء نسخة من TiffOptions وتعيين خصائصه المتنوعة
    com.aspose.imaging.imageoptions.TiffOptions tiffOptions = new com.aspose.imaging.imageoptions.TiffOptions(com.aspose.imaging.fileformats.tiff.enums.TiffExpectedFormat.Default);

    // تعيين المصدر لنسخة ImageOptions
    tiffOptions.setSource(new com.aspose.imaging.sources.StreamSource(stream));

    // إنشاء نسخة من Image
    com.aspose.imaging.Image image = com.aspose.imaging.Image.create(tiffOptions, 500, 500);
    try {
        // إنشاء وتهيئة نسخة من فئة Graphics
        com.aspose.imaging.Graphics graphics = new com.aspose.imaging.Graphics(image);

        // مسح سطح Graphics
        graphics.clear(com.aspose.imaging.Color.getWheat());

        // إنشاء نسخة من فئة GraphicsPath
        com.aspose.imaging.GraphicsPath graphicspath = new com.aspose.imaging.GraphicsPath();

        // إنشاء نسخة من فئة Figure
        com.aspose.imaging.Figure figure = new com.aspose.imaging.Figure();

        // إضافة أشكال إلى كائن Figure
        figure.addShape(new com.aspose.imaging.shapes.RectangleShape(new com.aspose.imaging.RectangleF(10, 10, 300, 300)));
        figure.addShape(new com.aspose.imaging.shapes.EllipseShape(new com.aspose.imaging.RectangleF(50, 50, 300, 300)));
        figure.addShape(
                new com.aspose.imaging.shapes.PieShape(new com.aspose.imaging.RectangleF(
                        new com.aspose.imaging.PointF(250, 250),
                        new com.aspose.imaging.SizeF(200, 200)),
                        0, 45));

        // إضافة كائن Figure إلى GraphicsPath
        graphicspath.addFigure(figure);

        // رسم مسار باستخدام كائن Pen باللون الأسود
        graphics.drawPath(new com.aspose.imaging.Pen(com.aspose.imaging.Color.getBlack(), 2), graphicspath);

        // حفظ جميع التغييرات.
        image.save();
    } finally {
        image.dispose();
    }
} finally {
    stream.dispose();
}

addShapes(Shape[] shapes)

public void addShapes(Shape[] shapes)

يضيف مجموعة من الأشكال إلى الشكل.

Parameters:

معاملنوعالوصف
shapesShape[]الأشكال للإضافة.

removeShape(Shape shape)

public void removeShape(Shape shape)

يزيل شكلاً من الشكل.

Parameters:

معاملنوعالوصف
shapeShapeالشكل للإزالة.

removeShapes(Shape[] shapes)

public void removeShapes(Shape[] shapes)

يزيل مجموعة من الأشكال من الشكل.

Parameters:

معاملنوعالوصف
shapesShape[]نطاق الأشكال للإزالة.

reverse()

public void reverse()

يعكس ترتيب أشكال هذا الشكل وترتيب نقاط الأشكال.

getBounds(Matrix matrix)

public RectangleF getBounds(Matrix matrix)

يحصل على حدود الكائن.

Parameters:

معاملنوعالوصف
matrixMatrixسيتم حساب المصفوفة التي سيتم تطبيقها قبل الحدود.

Returns: RectangleF - The estimated object’s bounds.

getBounds(Matrix matrix, Pen pen)

public RectangleF getBounds(Matrix matrix, Pen pen)

يحصل على حدود الكائن.

Parameters:

معاملنوعالوصف
matrixMatrixسيتم حساب المصفوفة التي سيتم تطبيقها قبل الحدود.
penPenالقلم المستخدم للكائن. يمكن أن يؤثر هذا على حجم حدود الكائن.

Returns: RectangleF - The estimated object’s bounds.

transform(Matrix transform)

public void transform(Matrix transform)

يطبق التحويل المحدد على الشكل.

Parameters:

معاملنوعالوصف
transformMatrixالتحويل الذي سيتم تطبيقه.

equals(Object obj)

public boolean equals(Object obj)

يحدد ما إذا كان الكائن المحدد مساويًا للكائن الحالي.

Parameters:

معاملنوعالوصف
objjava.lang.Objectالكائن المقارن.

Returns: منطقي - نتيجة equals

hashCode()

public int hashCode()

يعمل كدالة التجزئة الافتراضية.

Returns: عدد صحيح - رمز تجزئة للكائن الحالي.