Class FileCreateSource
Nombre del espacio: Aspose.Imaging.Sources Asamblea: Aspose.Imaging.dll (25.4.0)
Representa una fuente de archivo para la creación.
[JsonObject(MemberSerialization.OptIn)]
public sealed class FileCreateSource : FileSource
Inheritance
object ← Source ← FileSource ← FileCreateSource
Miembros heredados
FileSource.IsTemporal ,y, Source.GetStreamContainer() ,y, object.GetType() ,y, object.ToString() ,y, object.Equals(object?) ,y, object.Equals(object?, object?) ,y, object.ReferenceEquals(object?, object?) ,y, object.GetHashCode()
Constructors
FileCreateSource(El string)
Inicia una nueva instancia de la clase Aspose.Imaging.Sources.FileCreateSource.
public FileCreateSource(string filePath)
Parameters
filePath
string
El camino de archivo para crear.
Examples
Este ejemplo crea un nuevo archivo de imagen en algún lugar del disco conforme especificado por la propiedad de fuente de la instancia BmpOptions. Si el segundo parámetro no se pasa al constructor de FileCreateSource, entonces por defecto el archivo que se creará tiene la propiedad IsTemporal establecida en 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(Cortesía, Bool)
Inicia una nueva instancia de la clase Aspose.Imaging.Sources.FileCreateSource.
[JsonConstructor]
public FileCreateSource(string filePath, bool isTemporal)
Parameters
filePath
string
El camino de archivo para crear.
isTemporal
bool
Si se establece para “verdad” el archivo creado será temporal.
Examples
Este ejemplo crea un nuevo archivo de imagen en algún lugar del disco conforme especificado por la propiedad de fuente de la instancia BmpOptions. Se establecen varias propiedades para la instancia BmpOptions antes de crear la imagen real.
//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
Obtenga la ruta de archivo para crear.
[JsonProperty]
public string FilePath { get; }
Valor de la propiedad
IsTemporal
Recibe un valor que indica si el archivo será temporal.
[JsonProperty]
public override bool IsTemporal { get; }
Valor de la propiedad
Methods
GetStreamContainer()
Tiene el contenedor de corriente.
public override StreamContainer GetStreamContainer()
Returns
El contenedor de corriente.
Remarks
Utilice con cautela.Tendrá que desmontar el contenedor de corriente después de la recuperación.