Class FileCreateSource
İsim alanı : Aspose.Imaging.Sources Toplantı: Aspose.Imaging.dll (25.4.0)
oluşturmak için bir dosya kaynağı oluşturur.
[JsonObject(MemberSerialization.OptIn)]
public sealed class FileCreateSource : FileSource
Inheritance
object ← Source ← FileSource ← FileCreateSource
mirasçı üyeleri
FileSource.IsTemporal , Source.GetStreamContainer() , object.GetType() , object.ToString() , object.Equals(object?) , object.Equals(object?, object?) , object.ReferenceEquals(object?, object?) , object.GetHashCode()
Constructors
FileCreateSource(Sırt)
Aspose.Imaging.Sources.FileCreateSource sınıfının yeni bir örneğini başlatır.
public FileCreateSource(string filePath)
Parameters
filePath
string
oluşturmak için dosya yolu.
Examples
Bu örnek, BmpOptions örneğinin Kaynak mülkiyeti tarafından belirtildiği gibi bir disk konumunda yeni bir Görüntü dosyası oluşturur. eğer ikinci parametre FileCreateSource’un yapımcısına aktarılmazsa, oluşturulacak dosya varsayılan olarak IsTemporal mülkiyeti True’a ayarlanır.
//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(Çerçeve , Bool)
Aspose.Imaging.Sources.FileCreateSource sınıfının yeni bir örneğini başlatır.
[JsonConstructor]
public FileCreateSource(string filePath, bool isTemporal)
Parameters
filePath
string
oluşturmak için dosya yolu.
isTemporal
bool
Eğer ‘gerçek’ olarak ayarlanırsa, oluşturulan dosya geçici olacaktır.
Examples
Bu örnek, BmpOptions örneğinin Kaynak özellikleri tarafından belirtildiği gibi bir disk konumunda yeni bir Görüntü dosyası oluşturur. BmpOptions örneğinin çeşitli özellikleri gerçek görüntü oluşturmadan önce ayarlanır.
//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
Oluşturmak için dosya yolu alır.
[JsonProperty]
public string FilePath { get; }
Mülkiyet Değer
IsTemporal
Dosyanın geçici olup olmadığını gösteren bir değer alır.
[JsonProperty]
public override bool IsTemporal { get; }
Mülkiyet Değer
Methods
GetStreamContainer()
Konteyner akışını alır.
public override StreamContainer GetStreamContainer()
Returns
Konteyner akışı için.
Remarks
Dikkatli bir şekilde kullanın. geri çekildikten sonra akış konteynerini çıkarmanız gerekecektir.