Draw Shapes in Page
Contents
[
Hide
]
Draw Polyline in Page
Aspose.Diagram for .NET API allows developers to draw a polyline shape in a page. In order to draw a polyline shape, the API offer DrawPolyline() method of the Diagram class. The code example below shows how to draw a polyline in a Visio drawing.
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_VisioPages(); | |
// Load diagram | |
Diagram diagram = new Diagram(dataDir + "Drawing1.vsdx"); | |
//Initiazlie a new PointF[] | |
PointF[] ps = new PointF[] { new PointF(1, 1), new PointF(2, 2), new PointF(4, 2), new PointF(3, 1) }; | |
//Draw polyline in page | |
diagram.Pages[0].DrawPolyline(1, 1, 2, 2, ps); | |
// Save diagram | |
diagram.Save(dataDir + "DrawPolylineInPage_out.vsdx", SaveFileFormat.VSDX); |
Draw Bezier in Page
Aspose.Diagram for .NET API allows developers to draw a bezier shape in a page. In order to draw a bezier shape, the API offer DrawBezier() method of the Diagram** **class. The code example below shows how to draw a bezier in a Visio drawing.
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_VisioPages(); | |
// Load diagram | |
Diagram diagram = new Diagram(dataDir + "Drawing1.vsdx"); | |
//Initiazlie a new PointF[] | |
PointF[] ps = new PointF[] { new PointF(1, 1), new PointF(2, 2), new PointF(3.79949292203676f, 0) }; | |
//Draw brezier in diagram | |
diagram.Pages[0].DrawBezier(1, 1, 2, 2, ps); | |
// Save diagram | |
diagram.Save(dataDir + "DrawBezierInPage_out.vsdx", SaveFileFormat.VSDX); |
Draw Spline in Page
Aspose.Diagram for .NET API allows developers to draw a spline shape in a page. In order to draw a bezier shape, the API offer DrawSpline() method of the Diagram** **class. The code example below shows how to draw a bezier in a Visio drawing.
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_VisioPages(); | |
// Load diagram | |
Diagram diagram = new Diagram(dataDir + "Drawing1.vsdx"); | |
//Initiazlie a new PointF[] | |
PointF[] ps = new PointF[] { new PointF(0, 0.3270758925347308f), | |
new PointF(0.2926845121364643f, 0.3581517392187368f), | |
new PointF(0.6526026522346893f, 0.4640748257705201f), | |
new PointF(1f, 0.327075892534732f) }; | |
//Draw Spline in diagram | |
diagram.Pages[0].DrawSpline(1, 1, 2, 2, ps); | |
// Save diagram | |
diagram.Save(dataDir + "DrawSplineInPage_out.vsdx", SaveFileFormat.VSDX); |