ทำงานกับขนาดและเค้าโครงของงานนำเสนอ
Contents
[
Hide
]
SlideSize.Type และ SlideSize.Size เป็นคุณสมบัติของคลาส Presentation ที่สามารถตั้งค่าหรือดึงค่าได้ตามที่แสดงในตัวอย่างด้านล่าง
ตัวอย่าง
string FilePath = @"..\..\..\Sample Files\";
string FileName = FilePath + "Working With Size and Layout.pptx";
//สร้างอ็อบเจกต์ Presentation ที่เป็นตัวแทนของไฟล์การนำเสนอ
Presentation presentation = new Presentation(FileName);
Presentation auxPresentation = new Presentation();
ISlide slide = presentation.Slides[0];
//ตั้งค่าขนาดสไลด์ของงานนำเสนอที่สร้างขึ้นให้เท่ากับของต้นฉบับ
auxPresentation.SlideSize.Type = presentation.SlideSize.Type;
auxPresentation.SlideSize.Size = presentation.SlideSize.Size;
auxPresentation.Slides.InsertClone(0, slide);
auxPresentation.Slides.RemoveAt(0);
//บันทึก Presentation ไปยังดิสก์
auxPresentation.Save(FileName, Aspose.Slides.Export.SaveFormat.Pptx);
ดาวน์โหลดโค้ดตัวอย่าง
ดาวน์โหลดตัวอย่างที่ทำงานได้
สำหรับรายละเอียดเพิ่มเติม ดูที่ เปลี่ยนขนาดสไลด์การนำเสนอใน .NET.