Class FileCreateSource

Class FileCreateSource

Der Name: Aspose.Imaging.Sources Versammlung: Aspose.Imaging.dll (25.4.0)

Es repräsentiert eine Dateiquelle für die Erstellung.

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

Inheritance

object Source FileSource FileCreateSource

Vererbte Mitglieder

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

Constructors

FileCreateSource(String)

Initialisiert eine neue Instanz der Aspose.Imaging.Sources.FileCreateSource Klasse.

public FileCreateSource(string filePath)

Parameters

filePath string

Der Dateiweg zu erstellen.

Examples

Dieses Beispiel erstellt eine neue Bilddatei an einem Diskort, wie von der Quell-Eigenschaft der BmpOptions-Einstellung angegeben. Wenn der zweite Parameter nicht an den Konstruktor von FileCreateSource übertragen wird, dann ist die Datei, die erstellt werden soll, standardmäßig die Eigenschaft IsTemporal auf True festgelegt. Mit IsTemporal auf True festgelegt, werden keine Dateien am Ende der Ausführung auf dem Disk gespeichert.

//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(String und Bool)

Initialisiert eine neue Instanz der Aspose.Imaging.Sources.FileCreateSource Klasse.

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

Parameters

filePath string

Der Dateiweg zu erstellen.

isTemporal bool

Wenn Sie auf “richtig” festgelegt sind, wird die erstellte Datei temporär sein.

Examples

Dieses Beispiel erstellt eine neue Bilddatei an einem Diskort, wie von der Quell-Eigenschaft der BmpOptions-Eigenschaft angegeben. Mehrere Eigenschaften für die BmpOptions-Eigenschaft werden vor der Erstellung der tatsächlichen Bild festgelegt.

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

Erhalten Sie den Dateiweg zu erstellen.

[JsonProperty]
public string FilePath { get; }

Eigentumswert

string

IsTemporal

Er erhält einen Wert, der angibt, ob die Datei vorübergehend ist.

[JsonProperty]
public override bool IsTemporal { get; }

Eigentumswert

bool

Methods

GetStreamContainer()

Geben Sie den Stromcontainer.

public override StreamContainer GetStreamContainer()

Returns

StreamContainer

Der Strom Container.

Remarks

Verwenden Sie mit Vorsicht. Sie müssen den Strombehälter nach der Rücknahme loswerden.

 Deutsch