Class FileCreateSource

Class FileCreateSource

nazivni prostor: Aspose.Imaging.Sources Sastav: Aspose.Imaging.dll (25.4.0)

Predstavlja izvor datoteke za stvaranje.

[JsonObject(MemberSerialization.OptIn)]
public sealed class FileCreateSource : FileSource

Inheritance

object Source FileSource FileCreateSource

naslijeđeni članovi

FileSource.IsTemporal , Source.GetStreamContainer() , object.GetType() , object.ToString() , object.Equals(object?) , object.Equals(object?, object?) , object.ReferenceEquals(object?, object?) , object.GetHashCode()

Constructors

FileCreateSource(String)

Inicijalizira novu primjenu Aspose.Imaging.Sources.FileCreateSource klase.

public FileCreateSource(string filePath)

Parameters

filePath string

Puta za izradu datoteke.

Examples

Ovaj primjer stvara novu sliku datoteku na nekoj lokaciji diska kako je navedeno izvorom svojstva primjera BmpOptions. Ako drugi parametar nije prebačen na graditelja FileCreateSource, onda podrazumevano da će se stvoriti ima svojstvo IsTemporal postavljen na 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(Sljedeći Članak Bool)

Inicijalizira novu primjenu Aspose.Imaging.Sources.FileCreateSource klase.

[JsonConstructor]
public FileCreateSource(string filePath, bool isTemporal)

Parameters

filePath string

Puta za izradu datoteke.

isTemporal bool

Ako se postavlja na ‘pravda’, stvorena datoteka će biti privremena.

Examples

Ovaj primjer stvara novu sliku datoteku na nekoj lokaciji diska, kako je navedeno izvornom vlasništvom primjere BmpOptions. Mnoge su svojstva za primjeru Bmpoptions postavljene prije stvaranja stvarne slike.

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

Pronađite put datoteke za stvaranje.

[JsonProperty]
public string FilePath { get; }

Vrijednost nekretnina

string

IsTemporal

Dobiva vrijednost koja ukazuje da li će datoteka biti privremena.

[JsonProperty]
public override bool IsTemporal { get; }

Vrijednost nekretnina

bool

Methods

GetStreamContainer()

Pronađite kontejner za struju.

public override StreamContainer GetStreamContainer()

Returns

StreamContainer

Kontejner za struju.

Remarks

Koristite s oprezom.Trebat ćete isporučiti kontejner za protok nakon povlačenja.

 Hrvatski