الفئة FileCreateSource

Summary: Represents a file source for creation.

Module: aspose.imaging.sources

Full Name: aspose.imaging.sources.FileCreateSource

Inheritance: FileSource

Constructors

Nameالوصف
FileCreateSource(file_path)يُنشئ مثلاً جديدًا من الفئة FileCreateSource.
FileCreateSource(file_path, is_temporal)يُنشئ مثلاً جديدًا من الفئة FileCreateSource.

Properties

NameTypeAccessالوصف
file_pathstringrيحصل على مسار الملف لإنشائه.
is_temporalboolrيحصل على قيمة تُشير إلى ما إذا كان الملف سيكون مؤقتًا.

Methods

Nameالوصف
get_stream_container()يحصل على حاوية الدفق.

Constructor: FileCreateSource(file_path)

 FileCreateSource(file_path) 

يُنشئ مثلاً جديدًا من الفئة FileCreateSource.

Parameters:

معاملنوعالوصف
file_pathstringمسار الملف لإنشائه.

See also:

Example # 1: This example creates a new Image file at some disk location as specified by `…

Constructor: FileCreateSource(file_path, is_temporal)

 FileCreateSource(file_path, is_temporal) 

يُنشئ مثلاً جديدًا من الفئة FileCreateSource.

Parameters:

معاملنوعالوصف
file_pathstringمسار الملف لإنشائه.
is_temporalboolإذا تم تعيينه إلى true سيكون الملف المُنشأ مؤقتًا.

See also:

Example # 1: This example creates a new Image file at some disk location as specified by S…

Method: get_stream_container()

 get_stream_container() 

يحصل على حاوية الدفق.

Returns

نوعالوصف
StreamContainerحاوية الدفق.

Examples

This example creates a new Image file at some disk location as specified by source property of the BmpOptions instance. If second parameter is not passed to the constructor of FileCreateSource, then by default the file to be created has property is_temporal set to True. With is_temporal set to True, no file will be saved on disk at the end of execution.

from aspose.imaging import Image
from aspose.imaging.imageoptions import BmpOptions
from aspose.imaging.sources import FileCreateSource

#يُنشئ مثلاً من BmpOptions ويضبط خصائصه المتنوعة
with BmpOptions() as bmp_options:
	bmp_options.bits_per_pixel = 24
	#إنشاء مثيل من `FileCreateSource` وتعيينه كـ `source` لمثيل `BmpOptions`
	#إذا لم يُمرّر المعامل الثاني، فإن الملف يكون بشكل افتراضي `is_temporal` مُعيّنًا إلى True
	bmp_options.source = FileCreateSource(r"C:\temp\output.bmp")
	#يُنشئ مثلاً من Image
	with Image.create(bmp_options, 500, 500) as image:
		#قم ببعض معالجة الصورة
		image.save()

This example creates a new Image file at some disk location as specified by Source property of the BmpOptions instance. Several properties for BmpOptions instance are set before creating the actual image. Especially the Source property, that refers to the actual disk location in this case.


from aspose.imaging import Image
from aspose.imaging.imageoptions import BmpOptions
from aspose.imaging.sources import FileCreateSource

#إنشاء مثيل من `BmpOptions` وتعيين خصائصه المتنوعة
with BmpOptions() as bmp_options:
	bmp_options.bits_per_pixel = 24

	#إنشاء مثيل من `FileCreateSource` وتعيينه كـ `source` لمثيل `BmpOptions`
	#المعامل `Boolean` الثاني يحدد ما إذا كان الملف الذي سيتم إنشاؤه مؤقتًا أم لا
	bmp_options.source = FileCreateSource(r"C:\temp\output.bmp", False)

	#إنشاء مثيل من Image وتهيئته بمثيل BmpOptions عن طريق استدعاء طريقة Create
	with Image.create(bmp_options, 500, 500) as image:
		#قم ببعض معالجة الصورة
		# احفظ جميع التغييرات
		image.save()