Class FileCreateSource

Class FileCreateSource

ja nimityö: Aspose.Imaging.Sources Kokoelma: Aspose.Imaging.dll (25.4.0)

Se on tiedoston lähde luomiseen.

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

Inheritance

object Source FileSource FileCreateSource

Perintöjäsenet

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

Constructors

FileCreateSource(String)

Aloitetaan uusi esimerkki Aspose.Imaging.Sources.FileCreateSource luokasta.

public FileCreateSource(string filePath)

Parameters

filePath string

Tiedoston reitti luodaan.

Examples

Tämä esimerkki luo uuden kuvan tiedoston jossakin levyn sijainnissa, kuten BmpOptionsin esimerkin lähdeominaisuus määrittelee. Jos toinen parametri ei siirry FileCreateSourcein rakentajalle, oletusarvoisesti luodaan tiedosto on ominaisuus IsTemporal asetettu 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(Sormus ja bool)

Aloitetaan uusi esimerkki Aspose.Imaging.Sources.FileCreateSource luokasta.

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

Parameters

filePath string

Tiedoston reitti luodaan.

isTemporal bool

Jos asetetaan “todelliseksi”, luotu tiedosto on tilapäinen.

Examples

Tämä esimerkki luo uuden kuvan tiedoston jossakin levyn sijainnissa, kuten on määritelty BmpOptions -tuotteen lähdeominaisuudesta. useita ominaisuuksia Bmoptions-tuotannolle asetetaan ennen todellisen kuvien luomista. Erityisesti Lähteominaisuus, joka viittaa tässä tapauksessa todelliseen levän sijaintiin.

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

Saat tiedoston polun luoda.

[JsonProperty]
public string FilePath { get; }

Omistuksen arvo

string

IsTemporal

Saat arvon, joka osoittaa, onko tiedosto tilapäinen.

[JsonProperty]
public override bool IsTemporal { get; }

Omistuksen arvo

bool

Methods

GetStreamContainer()

Valitse säiliön kontti.

public override StreamContainer GetStreamContainer()

Returns

StreamContainer

virran säiliöön.

Remarks

Käytä varovasti. sinun on poistettava virran säiliö takaisin saattamisen jälkeen.

 Suomi