Bild einfügen
DasBuchseiteObjekt stellt den Zeichenbereich einer Vordergrundseite oder einer Hintergrundseite dar. Die Pages-Eigenschaft, die von derDiagram -Klasse unterstützt eine Sammlung von Aspose.Diagram.Page-Objekten.
Bild in Visio einfügen
Aspose.Diagram for .NET API ermöglicht Entwicklern das Einfügen einer Bildform in eine Seite. Das folgende Codebeispiel zeigt, wie Sie ein Bild in eine Visio-Zeichnung einfügen.
// 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); |
Bild in SVG einfügen
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); |
Bild in PNG einfügen
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); |
Bild in PDF einfügen
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); |
Bild in HTML einfügen
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()); |