Class FileCreateSource
Navne til: Aspose.Imaging.Sources Sammensætning: Aspose.Imaging.dll (25.4.0)
Det repræsenterer en fil kilde til oprettelse.
[JsonObject(MemberSerialization.OptIn)]
public sealed class FileCreateSource : FileSource
Inheritance
object ← Source ← FileSource ← FileCreateSource
De arvede medlemmer
FileSource.IsTemporal , Source.GetStreamContainer() , object.GetType() , object.ToString() , object.Equals(object?) , object.Equals(object?, object?) , object.ReferenceEquals(object?, object?) , object.GetHashCode()
Constructors
FileCreateSource(String)
Initialiserer en ny instans af Aspose.Imaging.Sources.FileCreateSource klasse.
public FileCreateSource(string filePath)
Parameters
filePath
string
Filen vej til at skabe.
Examples
Dette eksempel skaber en ny Image-fil på en disk placering som angivet af kildeegenskaber i BmpOptions-instans. Hvis den anden parameter ikke overføres til FileCreateSource-konstruktoren, så ved standard filen til at blive skabt har egenskab IsTemporal indstillet til 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 og Bool)
Initialiserer en ny instans af Aspose.Imaging.Sources.FileCreateSource klasse.
[JsonConstructor]
public FileCreateSource(string filePath, bool isTemporal)
Parameters
filePath
string
Filen vej til at skabe.
isTemporal
bool
Hvis du indstiller til ’true’, vil den skabte fil være midlertidig.
Examples
Dette eksempel skaber en ny Image-fil på et bestemt disksted, som angivet af kildeegenskaben i BmpOptions-instans. Flere egenskaber for Bmoptions instans er indstillet, før den virkelige image skabes.
//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
Få filen vej til at oprette.
[JsonProperty]
public string FilePath { get; }
Ejendomsværdi
IsTemporal
Giver en værdi, der angiver, om filen vil være midlertidig.
[JsonProperty]
public override bool IsTemporal { get; }
Ejendomsværdi
Methods
GetStreamContainer()
Gennemstrømning af containeren.
public override StreamContainer GetStreamContainer()
Returns
Det er containerens strøm.
Remarks
Brug med forsigtighed. Du vil nødt til at slippe strøm containeren efter tilbagekaldelse.