Insertar imagen
losPáginaobjeto representa el área de dibujo de una página de primer plano o una página de fondo. La propiedad Pages expuesta por elDiagram La clase admite una colección de objetos Aspose.Diagram.Page.
Insertar imagen en Visio
Aspose.Diagram for .NET API permite a los desarrolladores insertar una forma de imagen en una página. El siguiente ejemplo de código muestra cómo insertar una imagen en un dibujo 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"); | |
Page page = diagram.Pages[0]; | |
double pinX = 3, pinY = 3, width = 4, hieght = 4; | |
using (FileStream fs = new FileStream("image.png", FileMode.Open)) | |
{ | |
page.AddShape(pinX, pinY, width, hieght, fs); | |
} | |
// Save diagram | |
diagram.Save(dataDir + "AddImageToPage_out.vsdx", SaveFileFormat.VSDX); |
Insertar imagen en SVG
Aspose.Diagram for .NET API allows developers to insert a image shape in a page. The code example below shows how to insert a image 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"); | |
Page page = diagram.Pages[0]; | |
double pinX = 3, pinY = 3, width = 4, hieght = 4; | |
using (FileStream fs = new FileStream("image.png", FileMode.Open)) | |
{ | |
page.AddShape(pinX, pinY, width, hieght, fs); | |
} | |
// Save diagram | |
diagram.Save(dataDir + "AddImageToPage_out.svg", SaveFileFormat.SVG); |
Insertar imagen en PNG
Aspose.Diagram for .NET API allows developers to insert a image shape in a page. The code example below shows how to insert a image 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"); | |
Page page = diagram.Pages[0]; | |
double pinX = 3, pinY = 3, width = 4, hieght = 4; | |
using (FileStream fs = new FileStream("image.png", FileMode.Open)) | |
{ | |
page.AddShape(pinX, pinY, width, hieght, fs); | |
} | |
// Save diagram | |
diagram.Save(dataDir + "AddImageToPage_out.png", SaveFileFormat.PNG); |
Insertar imagen en PDF
Aspose.Diagram for .NET API allows developers to insert a image shape in a page. The code example below shows how to insert a image 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"); | |
Page page = diagram.Pages[0]; | |
double pinX = 3, pinY = 3, width = 4, hieght = 4; | |
using (FileStream fs = new FileStream("image.png", FileMode.Open)) | |
{ | |
page.AddShape(pinX, pinY, width, hieght, fs); | |
} | |
// Save diagram | |
diagram.Save(dataDir + "AddImageToPage_out.pdf", SaveFileFormat.PDF); |
Insertar imagen en HTML
Aspose.Diagram for .NET API allows developers to insert a image shape in a page. The code example below shows how to insert a image 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"); | |
Page page = diagram.Pages[0]; | |
double pinX = 3, pinY = 3, width = 4, hieght = 4; | |
using (FileStream fs = new FileStream("image.png", FileMode.Open)) | |
{ | |
page.AddShape(pinX, pinY, width, hieght, fs); | |
} | |
// Save diagram | |
diagram.Save(dataDir + "AddImageToPage_out.html", new HTMLSaveOptions()); |