فئة PathResourceConverter
محتويات
[
يخفي
]Summary: Converts PathResource to GraphicsPath and vice versa.
Module: aspose.imaging.fileformats.tiff.pathresources
Full Name: aspose.imaging.fileformats.tiff.pathresources.PathResourceConverter
Methods
| Name | الوصف |
|---|---|
| from_graphics_path(graphics_path, image_size) | يقوم بتحويل نسخة GraphicsPath إلى موارد المسار. |
| to_graphics_path(path_resources, image_size) | يقوم بتحويل موارد المسار إلى نسخة GraphicsPath. |
Method: from_graphics_path(graphics_path, image_size) [static]
from_graphics_path(graphics_path, image_size)
يقوم بتحويل نسخة GraphicsPath إلى موارد المسار.
Parameters:
| معامل | نوع | الوصف |
|---|---|---|
| graphics_path | GraphicsPath | مسار الرسومات. |
| image_size | Size | حجم الصورة. |
Returns
| نوع | الوصف |
|---|---|
| PathResource[] | موارد المسار. |
Method: to_graphics_path(path_resources, image_size) [static]
to_graphics_path(path_resources, image_size)
يقوم بتحويل موارد المسار إلى نسخة GraphicsPath.
Parameters:
| معامل | نوع | الوصف |
|---|---|---|
| path_resources | PathResource[] | موارد المسار. |
| image_size | Size | حجم الصورة. |
Returns
| نوع | الوصف |
|---|---|
| GraphicsPath | نسخة GraphicsPath. |
Examples
Create Graphics Path from Path Resources in TIFF image.
import aspose.pycore as aspycore
from aspose.imaging import Image, Graphics, Color, Pen
from aspose.imaging.fileformats.tiff import TiffImage
from aspose.imaging.fileformats.tiff.pathresources import PathResourceConverter
with aspycore.as_of(Image.load("Bottle.tif"), TiffImage) as image:
# إنشاء GraphicsPath باستخدام PathResources من صورة TIFF
active_frame = image.active_frame
graphics_path = PathResourceConverter.to_graphics_path(active_frame.path_resource, active_frame.size)
graphics = Graphics(image)
# ارسم خطًا أحمر واحفظ الصورة
graphics.draw_path(Pen(Color.red, 10), graphics_path)
image.save("BottleWithRedBorder.tif")