Class FileCreateSource

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.

//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. Кілька властивостей для припущення Bmoptions встановлюються перед створенням реального знімку.

//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; }

вартість нерухомості

string

IsTemporal

Отримається значення, яке вказує на те, чи буде файл тимчасовим.

[JsonProperty]
public override bool IsTemporal { get; }

вартість нерухомості

bool

Methods

GetStreamContainer()

Використовуйте контейнер для потоку.

public override StreamContainer GetStreamContainer()

Returns

StreamContainer

Потік контейнерів

Remarks

Використовуйте з обережністю. Ви повинні розпустити поточний контейнер після відновлення.

 Українська