Konvertera en Visio form till bild
Contents
[
Hide
]
Konvertera en visio-form till bild
Det här ämnet utvecklar hur utvecklare kan konvertera en visio-form till bild med Aspose.Diagram. ToImage-metoden exponerad avForm klass kan användas för att konvertera till bild.
Koden nedan visar hur man:
- Ladda ett prov diagram.
- skaffa en viss sida.
- få en speciell form.
- konvertera form till bild.
Form till bild Programmeringsexempel
Använd följande kod i din .net-applikation för att konvertera en visio-form till en bild.
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); |