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
Овај пример креира нову слику датотеку на неком локацији диска, као што је наведено по својству Извора примера БмпОптионс. Ако се други параметар не преноси конструктору ФилеКреатеСорце, онда по подразумевању дат који ће бити створен има својство Истемпорал постављен на Тврде.
//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
Овај пример креира нови Слика датотеку на неком локацији диска, као што је наведено изворном својством инстанције Бмпоптионс. Неколико својстава за Инстанцију БМп опције се поставља пре стварања стварног слике.
//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
Користите са пажњом. мораћете да распоредите контејнер струје након повраћања.