Class FileCreateSource
اسم الفضاء : Aspose.Imaging.Sources تجميع: Aspose.Imaging.dll (25.4.0)
يمثل مصدر الملفات للإنشاء.
[JsonObject(MemberSerialization.OptIn)]
public sealed class FileCreateSource : FileSource
Inheritance
object ← Source ← FileSource ← FileCreateSource
الأعضاء الموروثين
FileSource.IsTemporal , Source.GetStreamContainer() , object.GetType() , object.ToString() , object.Equals(object?) , object.Equals(object?, object?) , object.ReferenceEquals(object?, object?) , object.GetHashCode()
Constructors
FileCreateSource(الستار)
يبدأ مثال جديد من فئة Aspose.Imaging.Sources.FileCreateSource.
public FileCreateSource(string filePath)
Parameters
filePath
string
مسار الملفات لإنشاء.
Examples
هذا المثال يخلق ملف صورة جديد في بعض مواقع القرص كما هو موضح من قبل خصائص المصدر في مثال BmpOptions.إذا لم يتم نقل المعيار الثاني إلى صانع FileCreateSource، ثم بشكل افتراضي الملف الذي سيتم إنشاؤه لديه خصائص IsTemporal إعداد إلى True.مع IsTemporal إعداد إلى True، لن يتم حفظ أي ملف على القرص في نهاية التنفيذ.
//Creates an instance of BmpOptions and set its various properties
Aspose.Imaging.ImageOptions.BmpOptions bmpOptions = new Aspose.Imaging.ImageOptions.BmpOptions();
bmpOptions.BitsPerPixel = 24;
//Create an instance of FileCreateSource and assign it as Source for the instance of BmpOptions
//If second parameter is not passed, then by default the file has IsTemporal set to True
bmpOptions.Source = new Aspose.Imaging.Sources.FileCreateSource(@"C:\temp\output.bmp");
//Creates an instance of Image
using (Aspose.Imaging.Image image = Aspose.Imaging.Image.Create(bmpOptions, 500, 500))
{
//do some image processing
}
FileCreateSource(البول، البول)
يبدأ مثال جديد من فئة Aspose.Imaging.Sources.FileCreateSource.
[JsonConstructor]
public FileCreateSource(string filePath, bool isTemporal)
Parameters
filePath
string
مسار الملفات لإنشاء.
isTemporal
bool
إذا قمت بتعيين “الحقيقة” ، فإن الملف الذي تم إنشاؤه سيكون مؤقتًا.
Examples
هذا المثال يخلق ملف الصورة الجديد في بعض مواقع القرص كما هو موضح من قبل خصائص المصدر في مثال BmpOptions. يتم تعيين العديد من الخصائص في مثال BmpOptions قبل إنشاء الصورة الحقيقية.
//Create an instance of BmpOptions and set its various properties
Aspose.Imaging.ImageOptions.BmpOptions bmpOptions = new Aspose.Imaging.ImageOptions.BmpOptions();
bmpOptions.BitsPerPixel = 24;
//Create an instance of FileCreateSource and assign it as Source for the instance of BmpOptions
//Second Boolean parameter determines if the file to be created IsTemporal or not
bmpOptions.Source = new Aspose.Imaging.Sources.FileCreateSource(@"C:\temp\output.bmp", false);
//Create an instance of Image and initialize it with instance of BmpOptions by calling Create method
using (Aspose.Imaging.Image image = Aspose.Imaging.Image.Create(bmpOptions, 500, 500))
{
//do some image processing
// save all changes
image.Save();
}
Properties
FilePath
يحصل على مسار الملفات لإنشاء.
[JsonProperty]
public string FilePath { get; }
قيمة الممتلكات
IsTemporal
يحصل على قيمة تشير إلى ما إذا كانت الملفات ستكون مؤقتة.
[JsonProperty]
public override bool IsTemporal { get; }
قيمة الممتلكات
Methods
GetStreamContainer()
تحصل على حاوية التدفق.
public override StreamContainer GetStreamContainer()
Returns
حاوية التدفق .
Remarks
استخدم بعناية.سوف تحتاج إلى إزالة حاوية التدفق بعد الاسترداد.