تحويل Visio شكل إلى صورة
Contents
[
Hide
]
تحويل شكل visio إلى صورة
يوضح هذا الموضوع كيف يمكن للمطورين تحويل شكل visio إلى صورة باستخدام Aspose.Diagram. طريقة ToImage التي كشفها ملفشكل يمكن استخدام فئة للتحويل إلى صورة.
يوضح الكود أدناه كيفية:
- تحميل عينة diagram.
- الحصول على صفحة معينة.
- الحصول على شكل معين.
- تحويل الشكل إلى صورة.
عينة برمجة من شكل إلى صورة
استخدم الكود التالي في تطبيق .net لتحويل شكل visio إلى صورة.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// For complete examples and data files, please go to https://github.com/aspose-diagram/Aspose.Diagram-for-.NET | |
// The path to the documents directory. | |
string dataDir = RunExamples.GetDataDir_Shapes(); | |
// Call a Diagram class constructor to load the VSDX diagram | |
Diagram diagram = new Diagram(dataDir + "ShapeToImage.vsdx"); | |
// Get a particular page | |
Page page = diagram.Pages[0]; | |
// Get a particular shape | |
Shape shape = page.Shapes[0]; | |
// Shape to Image | |
Aspose.Diagram.Saving.ImageSaveOptions o = new Aspose.Diagram.Saving.ImageSaveOptions(SaveFileFormat.PNG); | |
shape.ToImage("out.png", o); |