Class FileCreateSource

Class FileCreateSource

Le nom : Aspose.Imaging.Sources Assemblée: Aspose.Imaging.dll (25.4.0)

È una fonte di file per la creazione.

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

Inheritance

object Source FileSource FileCreateSource

I membri ereditari

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

Constructors

FileCreateSource(Le string)

Initialisez une nouvelle instance de la classe Aspose.Imaging.Sources.FileCreateSource.

public FileCreateSource(string filePath)

Parameters

filePath string

Il percorso di file da creare.

Examples

Cet exemple crée un nouveau fichier Image sur un certain endroit du disque tel que spécifié par la propriété Source de l’instant BmpOptions. Si le second paramètre n’est pas transmis au constructeur de FileCreateSource, alors par défaut le dossier à créer a une propriétés IsTemporal définie à 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(Télécharger, Bool)

Initialisez une nouvelle instance de la classe Aspose.Imaging.Sources.FileCreateSource.

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

Parameters

filePath string

Il percorso di file da creare.

isTemporal bool

Se impostato a ‘verità’ il file creato sarà temporaneo.

Examples

Cet exemple crée un nouveau fichier Image dans une certaine localisation disque tel que spécifié par la propriété Source de l’instant BmpOptions. Plusieurs propriétés pour l’instance Bmoptions sont définis avant la création de la vraie image.

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

Ottieni il percorso di file per creare.

[JsonProperty]
public string FilePath { get; }

Valore di proprietà

string

IsTemporal

Riceve un valore che indica se il file sarà temporaneo.

[JsonProperty]
public override bool IsTemporal { get; }

Valore di proprietà

bool

Methods

GetStreamContainer()

Il contenitore di flusso.

public override StreamContainer GetStreamContainer()

Returns

StreamContainer

Il contenitore di flusso.

Remarks

Utilizzare con cautela. avrai bisogno di disporre il contenitore di flusso dopo il recupero.

 Français