Class FileCreateSource

Class FileCreateSource

ชื่อพื้นที่: Aspose.Imaging.Sources การประกอบ: Aspose.Imaging.dll (25.4.0)

แสดงเป็นแหล่งไฟล์สําหรับการสร้าง

[JsonObject(MemberSerialization.OptIn)]
public sealed class FileCreateSource : FileSource

Inheritance

object Source FileSource FileCreateSource

อนุญาโตตุลาการ

FileSource.IsTemporal , Source.GetStreamContainer() , object.GetType() , object.ToString() , object.Equals(object?) , object.Equals(object?, object?) , object.ReferenceEquals(object?, object?) , object.GetHashCode()

Constructors

FileCreateSource(รั้ว)

เปิดตัวตัวอย่างใหม่ของคลาส Aspose.Imaging.Sources.FileCreateSource

public FileCreateSource(string filePath)

Parameters

filePath string

ไฟล์เส้นทางที่จะสร้าง

Examples

ตัวอย่างนี้สร้างไฟล์ภาพใหม่ในสถานที่ของดิสก์ตามที่ระบุโดยคุณสมบัติแหล่งของตัวอย่าง BmpOptions หากพารามิเตอร์ที่สองไม่ได้ส่งไปยังผู้สร้าง FileCreateSource จากนั้นโดยเริ่มต้นไฟล์ที่สร้างมีคุณสมบัติ IsTemporal ที่ตั้งค่าเป็น True ด้วย IsTemporal ที่ตั้งค่าเป็น 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(บอล, บอล)

เปิดตัวตัวอย่างใหม่ของคลาส Aspose.Imaging.Sources.FileCreateSource

[JsonConstructor]
public FileCreateSource(string filePath, bool isTemporal)

Parameters

filePath string

ไฟล์เส้นทางที่จะสร้าง

isTemporal bool

หากตั้งค่าเป็น “จริง” ไฟล์ที่สร้างจะเป็นเวลา

Examples

ตัวอย่างนี้สร้างไฟล์ภาพใหม่ในสถานที่ของดิสก์บางอย่างตามที่ระบุโดยคุณสมบัติแหล่งของตัวอย่าง BmpOptions คุณสมบัติหลายตัวสําหรับตัวอย่าง BmpOptions ถูกตั้งค่าก่อนที่จะสร้างภาพจริง โดยเฉพาะอย่างยิ่งคุณสมบัติแหล่งซึ่งหมายถึงสถานที่ของดิสก์จริงในกรณีนี้

//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

รับเส้นทางไฟล์เพื่อสร้าง

[JsonProperty]
public string FilePath { get; }

คุณสมบัติมูลค่า

string

IsTemporal

ได้รับค่าแสดงให้เห็นว่าไฟล์จะเป็นเวลา

[JsonProperty]
public override bool IsTemporal { get; }

คุณสมบัติมูลค่า

bool

Methods

GetStreamContainer()

ได้รับการไหลของภาชนะ

public override StreamContainer GetStreamContainer()

Returns

StreamContainer

กระแสภาชนะ

Remarks

ใช้ด้วยความระมัดระวัง คุณจะต้องจัดเก็บกระแสหลังจากการรับ

 แบบไทย