Class FileCreateSource

Class FileCreateSource

Název místa: Aspose.Imaging.Sources Shromáždění: Aspose.Imaging.dll (25.4.0)

Představuje zdroj souborů pro tvorbu.

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

Inheritance

object Source FileSource FileCreateSource

Dědiční členové

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

Constructors

FileCreateSource(Stringová)

Začíná nový příklad třídy Aspose.Imaging.Sources.FileCreateSource.

public FileCreateSource(string filePath)

Parameters

filePath string

Cesta k vytvoření souboru.

Examples

Tento příklad vytváří nový soubor snímku na nějakém místě disku, jak je specifikováno vlastností zdroje příkladu BmpOptions. Pokud druhý parametr není přenesen do konstruktoru FileCreateSource, pak dle výchozího nastavení vytvořený soubor má vlastnost IsTemporal nastaven 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(Stringová, boolová)

Začíná nový příklad třídy Aspose.Imaging.Sources.FileCreateSource.

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

Parameters

filePath string

Cesta k vytvoření souboru.

isTemporal bool

Pokud je nastaven na “pravdivý”, vytvořený soubor bude dočasn.

Examples

Tento příklad vytváří nový soubor snímku na některém místě disku, jak je specifikováno vlastností zdroje příkladu BmpOptions. Některé vlastnosti pro příkladu BmpOptions jsou nastaveny před vytvořením skutečného obrazu.

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

Získáte souborovou cestu k vytvořen.

[JsonProperty]
public string FilePath { get; }

Hodnota nemovitosti

string

IsTemporal

Obdrží hodnotu, která naznačuje, zda bude soubor dočasn.

[JsonProperty]
public override bool IsTemporal { get; }

Hodnota nemovitosti

bool

Methods

GetStreamContainer()

Dostanete proudový kontejner.

public override StreamContainer GetStreamContainer()

Returns

StreamContainer

Přechodový kontejner.

Remarks

Použijte s opatrností. budete muset rozložit proudový kontejner po převzet.

 Čeština