Class FileCreateSource
Il nome: Aspose.Imaging.Sources Assemblea: 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(String)
Inizia una nuova instanza della classe Aspose.Imaging.Sources.FileCreateSource.
public FileCreateSource(string filePath)
Parameters
filePath
string
Il percorso di file da creare.
Examples
Questo esempio crea un nuovo file Immagine in qualche posizione del disco come specificato dalla proprietà Source dell’esempio BmpOptions. Se il secondo parametro non viene trasferito al costruttore di FileCreateSource, quindi per impostazione predefinita il file da creare ha proprietà IsTemporal impostato a 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(String e Bool)
Inizia una nuova instanza della 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
Questo esempio crea un nuovo file di Immagine in qualche posizione del disco come specificato dalla proprietà Source dell’esempio BmpOptions. Diverse proprietà per l’installazione Bmoptions sono impostate prima di creare la immagine reale. In particolare, la proprietà della Fonte, che si riferisce all’attuale posizione disco in questo caso.
//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à
IsTemporal
Riceve un valore che indica se il file sarà temporaneo.
[JsonProperty]
public override bool IsTemporal { get; }
Valore di proprietà
Methods
GetStreamContainer()
Il contenitore di flusso.
public override StreamContainer GetStreamContainer()
Returns
Il contenitore di flusso.
Remarks
Utilizzare con cautela. avrai bisogno di disporre il contenitore di flusso dopo il recupero.