Diamant zeichnen
Zeichnen Sie Diamant in Visio
Aspose.Diagram for .NET API ermöglicht es Entwicklern, eine Rautenform auf einer Seite zu zeichnen. Das folgende Codebeispiel zeigt, wie eine Raute in einer Visio-Zeichnung gezeichnet wird.
// 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, 2), new PointF(2, 0), new PointF(3, 2), new PointF(2, 4), new PointF(1, 2) }; | |
//Draw Diamond in page | |
diagram.Pages[0].DrawPolyline(1, 1, 2, 2, ps); | |
// Save diagram | |
diagram.Save(dataDir + "DrawDiamondInPage_out.vsdx", SaveFileFormat.VSDX); |
Zeichnen Sie Diamant in SVG
Aspose.Diagram for .NET API allows developers to draw a diamond in the page and save as SVG format. The code example below shows how to draw a diamond in a Visio drawing and save as SVG format.
// 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, 2), new PointF(2, 0), new PointF(3, 2), new PointF(2, 4), new PointF(1, 2) }; | |
//Draw Diamond in page | |
diagram.Pages[0].DrawPolyline(1, 1, 2, 2, ps); | |
// Save diagram as SVG images | |
SVGSaveOptions imageSaveOptions = new SVGSaveOptions(); | |
imageSaveOptions.PageIndex = 0; | |
diagram.Save(dataDir + "DrawDiamondInPage_out.svg", imageSaveOptions); |
Zeichnen Sie Diamant in PDF
Aspose.Diagram for .NET API allows developers to draw a diamond in the page and save as PDF format. The code example below shows how to draw a diamond in a Visio drawing and save as PDF format.
// 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, 2), new PointF(2, 0), new PointF(3, 2), new PointF(2, 4), new PointF(1, 2) }; | |
//Draw Diamond in page | |
diagram.Pages[0].DrawPolyline(1, 1, 2, 2, ps); | |
// Save diagram | |
diagram.Save(dataDir + "DrawDiamondInPage_out.pdf", new PdfSaveOptions()); |
Zeichnen Sie Diamant in PNG
Aspose.Diagram for .NET API allows developers to draw a diamond in the page and save as PNG format. The code example below shows how to draw a diamond in a Visio drawing and save as PNG format.
// 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, 2), new PointF(2, 0), new PointF(3, 2), new PointF(2, 4), new PointF(1, 2) }; | |
//Draw Diamond in page | |
diagram.Pages[0].DrawPolyline(1, 1, 2, 2, ps); | |
// Save diagram as PNG image | |
ImageSaveOptions imageSaveOptions = new ImageSaveOptions(SaveFileFormat.PNG); | |
imageSaveOptions.PageIndex = 0; | |
diagram.Save(dataDir + "DrawDiamondInPage_out.png", imageSaveOptions); |
Zeichnen Sie Diamant in HTML
Aspose.Diagram for .NET API allows developers to draw a diamond in the page and save as HTML format. The code example below shows how to draw a diamond in a Visio drawing and save as HTML format.
// 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, 2), new PointF(2, 0), new PointF(3, 2), new PointF(2, 4), new PointF(1, 2) }; | |
//Draw Diamond in page | |
diagram.Pages[0].DrawPolyline(1, 1, 2, 2, ps); | |
// Save diagram | |
diagram.Save(dataDir + "DrawDiamondInPage_out.html", new HTMLSaveOptions()); |