فئة ApngOptions
Summary: The API for Animated PNG (Animated Portable Network Graphics) image file format
creation is a dynamic tool for developers seeking to generate captivating
animated images. With customizable options such as frame duration and the
number of times to loop, this API allows for fine-tuning animated content
according to specific needs. Whether creating engaging web graphics or
interactive visuals, you can leverage this API to seamlessly incorporate
APNG images with precise control over animation parameters.
Module: aspose.imaging.imageoptions
Full Name: aspose.imaging.imageoptions.ApngOptions
Inheritance: IMetadataContainer, IHasExifData, IHasMetadata, IHasXmpData, PngOptions
Constructors
| Name | الوصف |
|---|---|
| ApngOptions() | ينشئ مثيلاً جديداً من الفئة ApngOptions. |
Properties
| Name | Type | Access | الوصف |
|---|---|---|---|
| DEFAULT_COMPRESSION_LEVEL [static] | PngCompressionLevel | r | مستوى الضغط الافتراضي. |
| bit_depth | System.Byte | r/w | يحصل أو يعيّن قيم عمق البت في النطاق 1، 2، 4، 8، 16. انتبه إلى الحدود التالية: PngColorType.INDEXED_COLOR يدعم عمق البت 1، 2، 4، 8. PngColorType.GRAYSCALE, PngColorType.GRAYSCALE_WITH_ALPHA يدعمان عمق البت 8. PngColorType.TRUECOLOR, PngColorType.TRUECOLOR_WITH_ALPHA يدعمان عمق البت 8، 16. |
| buffer_size_hint | int | r/w | يحصل أو يعيّن تلميح حجم المخزن المؤقت الذي يُعرف كأقصى حجم مسموح به لجميع المخازن الداخلية. |
| color_type | PngColorType | r/w | يحصل أو يعيّن نوع اللون. |
| compression_level | int | r/w | يحصل أو يعيّن مستوى ضغط PngImage. |
| default_frame_time | int | r/w | يحصل أو يعيّن مدة الإطار الافتراضية. |
| تم التخلص | bool | r | يحصل على قيمة تشير إلى ما إذا كانت هذه المثيلة تم التخلص منها. |
| exif_data | ExifData | r/w | يحصل أو يعيّن كائن Exif. |
| filter_type | PngFilterType | r/w | يحصل أو يعيّن نوع الفلتر المستخدم أثناء عملية حفظ ملف png. |
| full_frame | bool | r/w | يحصل أو يعيّن قيمة تشير إلى ما إذا كان [full frame]. |
| keep_metadata | bool | r/w | يحصل على قيمة ما إذا كان يجب الاحتفاظ ببيانات التعريف الأصلية للصورة عند التصدير. |
| multi_page_options | MultiPageOptions | r/w | خيارات الصفحات المتعددة |
| num_plays | int | r/w | يحصل أو يعيّن عدد مرات تكرار الرسوم المتحركة. 0 يدل على تكرار لا نهائي. |
| palette | IColorPalette | r/w | يحصل أو يضبط لوحة الألوان. |
| png_compression_level | PngCompressionLevel | r/w | يحصل أو يعيّن مستوى ضغط PngImage. |
| progressive | bool | r/w | يحصل أو يعيّن قيمة تشير إلى ما إذا كان PngImage تقدميًا. |
| resolution_settings | ResolutionSetting | r/w | يحصل أو يضبط إعدادات الدقة. |
| source | Source | r/w | يحصل أو يضبط المصدر لإنشاء الصورة فيه. |
| vector_rasterization_options | VectorRasterizationOptions | r/w | يحصل أو يضبط خيارات تحويل المتجه إلى نقطية. |
| xmp_data | XmpPacketWrapper | r/w | يحصل أو يضبط بيانات Xmp. |
Methods
| Name | الوصف |
|---|---|
| clone() | ينشئ نسخة متماثلة لهذا الكائن. |
| try_set_metadata(metadata) | يحاول ضبط مثال metadata، إذا كان مثال هذا Image يدعم ويطبق مثال IImageMetadataFormat . |
Constructor: ApngOptions()
ApngOptions()
ينشئ مثيلاً جديداً من الفئة ApngOptions.
Property: default_frame_time
يحصل أو يعيّن مدة الإطار الافتراضية.
See also:
Example # 1: The following example shows how to export apng APNG file format from other no…
Property: num_plays
يحصل أو يعيّن عدد مرات تكرار الرسوم المتحركة.
0 يدل على تكرار لا نهائي.
See also:
Example # 1: The following example shows how to export to APNG file format.
Method: clone()
clone()
ينشئ نسخة متماثلة لهذا الكائن.
Returns
| نوع | الوصف |
|---|---|
| ImageOptionsBase | نسخة متماثلة لهذا الكائن. |
Method: try_set_metadata(metadata)
try_set_metadata(metadata)
يحاول ضبط مثال metadata، إذا كان مثال هذا Image يدعم ويطبق مثال IImageMetadataFormat .
Parameters:
| معامل | نوع | الوصف |
|---|---|---|
| metadata | IImageMetadataFormat | البيانات الوصفية. |
Returns
| نوع | الوصف |
|---|---|
| bool | صحيح إذا كان metadata غير فارغ وكانت نسخة IMetadataContainer تدعم و/أو تنفذ نسخة IImageMetadataFormat; وإلا، خطأ. |
Examples
The following example shows how to export to APNG file format.
import aspose.pycore as aspycore
from aspose.imaging import *
from aspose.imaging.imageoptions import *
with Image.load("Animation1.webp") as image:
# تصدير إلى رسوم متحركة APNG مع دورات رسوم متحركة غير محدودة كإعداد افتراضي
image.save("Animation1.webp.png", ApngOptions())
# إعداد دورات الرسوم المتحركة
obj_init = ApngOptions()
# 5 دورات
obj_init.num_plays = 5
image.save("Animation2.webp.png", obj_init)
The following example shows how to export apng APNG file format from other non-animated multi-page format.
from aspose.imaging import Image
from aspose.imaging.imageoptions import ApngOptions
with Image.load("img4.tif") as image:
# إعداد مدة الإطار الافتراضية
obj_init = ApngOptions()
# 500 مللي ثانية
obj_init.default_frame_time = 500
image.save("img4.tif.500ms.png", obj_init)
obj_init2 = ApngOptions()
# 250 مللي ثانية
obj_init2.default_frame_time = 250
image.save("img4.tif.250ms.png", obj_init2)