Dessiner un carré
Dessiner carré en Visio
Aspose.Diagram for .NET API permet aux développeurs de dessiner une forme carrée dans une page. L’exemple de code ci-dessous montre comment dessiner un carré dans un dessin Visio.
// 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"); | |
//Draw square in page | |
diagram.Pages[0].DrawRectangle(1, 1, 2, 2); | |
// Save diagram | |
diagram.Save(dataDir + "DrawSquareInPage_out.vsdx", SaveFileFormat.VSDX); |
Dessiner carré en SVG
Aspose.Diagram for .NET API allows developers to draw a square in the page and save as SVG format. The code example below shows how to draw a square 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"); | |
//Draw square in page | |
diagram.Pages[0].DrawRectangle(1, 1, 2, 2); | |
// Save diagram as SVG images | |
SVGSaveOptions imageSaveOptions = new SVGSaveOptions(); | |
imageSaveOptions.PageIndex = 0; | |
diagram.Save(dataDir + "DrawSquareInPage_out.svg", imageSaveOptions); |
Dessiner carré en PDF
Aspose.Diagram for .NET API allows developers to draw a square in the page and save as PDF format. The code example below shows how to draw a square 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"); | |
//Draw square in page | |
diagram.Pages[0].DrawRectangle(1, 1, 2, 2); | |
// Save diagram | |
diagram.Save(dataDir + "DrawSquareInPage_out.pdf", new PdfSaveOptions()); |
Dessiner carré en PNG
Aspose.Diagram for .NET API allows developers to draw a square in the page and save as PNG format. The code example below shows how to draw a square 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"); | |
//Draw square in page | |
diagram.Pages[0].DrawRectangle(1, 1, 2, 2); | |
// Save diagram as PNG image | |
ImageSaveOptions imageSaveOptions = new ImageSaveOptions(SaveFileFormat.PNG); | |
imageSaveOptions.PageIndex = 0; | |
diagram.Save(dataDir + "DrawSquareInPage_out.png", imageSaveOptions); |
Dessiner carré en HTML
Aspose.Diagram for .NET API allows developers to draw a square in the page and save as HTML format. The code example below shows how to draw a square 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"); | |
//Draw square in page | |
diagram.Pages[0].DrawRectangle(1, 1, 2, 2); | |
// Save diagram | |
diagram.Save(dataDir + "DrawSquareInPage_out.html", new HTMLSaveOptions()); |