Class FileCreateSource

Class FileCreateSource

A név: Aspose.Imaging.Sources Összefoglaló: Aspose.Imaging.dll (25.4.0)

A fájl forrása a létrehozáshoz.

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

Inheritance

object Source FileSource FileCreateSource

Örökletes tagok

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

Constructors

FileCreateSource(A string)

Kezdődik egy új példány a Aspose.Imaging.Sources.FileCreateSource osztály.

public FileCreateSource(string filePath)

Parameters

filePath string

A fájl útvonal létrehozása.

Examples

Ez a példa létrehoz egy új kép fájl valamilyen lemez helyén, ahogyan azt a forrás tulajdonsága a BmpOptions példában. Ha a második paraméter nem kerül át a FileCreateSource konstruktőr, akkor alapértelmezés szerint a készítendő dokumentum tulajdonát IsTemporal beállított 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(Szilveszter, Bool)

Kezdődik egy új példány a Aspose.Imaging.Sources.FileCreateSource osztály.

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

Parameters

filePath string

A fájl útvonal létrehozása.

isTemporal bool

Ha „igaz” a létrehozott fájl lesz ideiglenes.

Examples

Ez a példa létrehoz egy új kép fájl valamilyen lemez helyén, ahogyan azt a forrás tulajdonsága a BmpOptions példányban. Számos jellemzőt a BMP Options mintában állítanak be, mielőtt a valós képet.

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

Megkapja a fájl útvonalat létrehozni.

[JsonProperty]
public string FilePath { get; }

ingatlan értéke

string

IsTemporal

Megkap egy értéket, amely jelzi, hogy a fájl ideiglenes-e.

[JsonProperty]
public override bool IsTemporal { get; }

ingatlan értéke

bool

Methods

GetStreamContainer()

Megkapja az áramtartót.

public override StreamContainer GetStreamContainer()

Returns

StreamContainer

A konténer áramlása.

Remarks

Használjon óvatosan. meg kell oldani az áramtartót a visszaküldés után.

 Magyar