Class FileCreateSource
De naam: Aspose.Imaging.Sources Verzameling: Aspose.Imaging.dll (25.4.0)
Een bestandbron voor de creatie.
[JsonObject(MemberSerialization.OptIn)]
public sealed class FileCreateSource : FileSource
Inheritance
object ← Source ← FileSource ← FileCreateSource
Geëerbiede leden
FileSource.IsTemporal , Source.GetStreamContainer() , object.GetType() , object.ToString() , object.Equals(object?) , object.Equals(object?, object?) , object.ReferenceEquals(object?, object?) , object.GetHashCode()
Constructors
FileCreateSource(String)
Initialiseert een nieuwe instantie van de Aspose.Imaging.Sources.FileCreateSource-klasse.
public FileCreateSource(string filePath)
Parameters
filePath
string
De bestandpad om te maken.
Examples
Dit voorbeeld creëert een nieuwe Image-bestand op een bepaalde plaat zoals aangegeven door de bron eigenschap van de BmpOptions instelling. Als de tweede parameter niet wordt overgedragen aan de constructor van FileCreateSource, dan door standaard de bestand die zal worden gecreëerd heeft de eigendom IsTemporal ingesteld op True. Met isTempororal geïntroduceerd naar True, zal geen bestanden worden op de schijf op het einde van uitvoering.
//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 en Bool)
Initialiseert een nieuwe instantie van de Aspose.Imaging.Sources.FileCreateSource-klasse.
[JsonConstructor]
public FileCreateSource(string filePath, bool isTemporal)
Parameters
filePath
string
De bestandpad om te maken.
isTemporal
bool
Als je ‘waar’ hebt ingesteld, zal de gecreëerde bestand tijdelijk zijn.
Examples
Dit voorbeeld creëert een nieuwe afbeeldingsbestand op een bepaalde plaat, zoals aangegeven door de bron eigendom van de BmpOptions instelling.Veel eigenschappen voor de bmpoptionsinstelling worden ingesteld voordat de werkelijke beeld wordt gecreëerd.
//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
Geeft de bestandpad om te maken.
[JsonProperty]
public string FilePath { get; }
Eigendomswaarde
IsTemporal
Geeft een waarde die aangeeft of het bestand tijdelijk zal zijn.
[JsonProperty]
public override bool IsTemporal { get; }
Eigendomswaarde
Methods
GetStreamContainer()
Geeft de stroom container.
public override StreamContainer GetStreamContainer()
Returns
De stroom container.
Remarks
Gebruik met voorzichtigheid. u zult de stroom container na terugvinding moeten loslaten.