Class FileCreateSource
Nama dari : Aspose.Imaging.Sources Pengumpulan: Aspose.Imaging.dll (25.4.0)
Ini adalah sumber file untuk penciptaan.
[JsonObject(MemberSerialization.OptIn)]
public sealed class FileCreateSource : FileSource
Inheritance
object ← Source ← FileSource ← FileCreateSource
anggota yang diwarisi
FileSource.IsTemporal , Source.GetStreamContainer() , object.GetType() , object.ToString() , object.Equals(object?) , object.Equals(object?, object?) , object.ReferenceEquals(object?, object?) , object.GetHashCode()
Constructors
FileCreateSource(String)
Initifikasi contoh baru dari kelas Aspose.Imaging.Sources.FileCreateSource.
public FileCreateSource(string filePath)
Parameters
filePath
string
jalur file untuk dibuat.
Examples
Contoh ini membuat file Image baru di lokasi cakera tertentu seperti yang ditentukan oleh Properti Sumber dari contoh BmpOptions. Jika parameter kedua tidak ditransfer ke pembuat FileCreateSource, maka secara default file yang akan dibuat memiliki Properti IsTemporal ditetapkan untuk True. Dengan IsTemporal ditetapkan untuk True, tidak ada file akan disimpan pada cakera pada akhir eksekusi.
//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(Kekuatan, Bool)
Initifikasi contoh baru dari kelas Aspose.Imaging.Sources.FileCreateSource.
[JsonConstructor]
public FileCreateSource(string filePath, bool isTemporal)
Parameters
filePath
string
jalur file untuk dibuat.
isTemporal
bool
Jika ditetapkan untuk ‘kebenaran’, file yang dibuat akan bersifat sementara.
Examples
Contoh ini menciptakan file Gambar baru di lokasi cakera tertentu seperti yang ditentukan oleh sifat Sumber dari contoh BmpOptions. Beberapa sifat untuk contoh BmpOptions ditetapkan sebelum membuat gambar nyata.
//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
Dapatkan jalur file untuk membuat.
[JsonProperty]
public string FilePath { get; }
Nilai Properti
IsTemporal
Dapatkan nilai yang menunjukkan apakah file akan bersifat sementara.
[JsonProperty]
public override bool IsTemporal { get; }
Nilai Properti
Methods
GetStreamContainer()
Dapatkan kontainer aliran.
public override StreamContainer GetStreamContainer()
Returns
Kontainer yang mengalir.
Remarks
Gunakan dengan hati-hati. Anda akan perlu menyingkirkan kontena aliran setelah pemulihan.