Infoga bild
DeSidaobjekt representerar ritytan på en förgrundssida eller en bakgrundssida. Sidornas egendom exponerad avDiagram klass stöder en samling av Aspose.Diagram.Page-objekt.
Infoga bild i Visio
Aspose.Diagram for .NET API tillåter utvecklare att infoga en bildform på en sida. Kodexemplet nedan visar hur man infogar en bild i en Visio-ritning.
// 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); |
Infoga bild i SVG
Aspose.Diagram for .NET API tillåter utvecklare att infoga en bildform på en sida. Kodexemplet nedan visar hur man infogar en bild i en Visio-ritning och sparar som 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); |
Infoga bild i PNG
Aspose.Diagram for .NET API tillåter utvecklare att infoga en bildform på en sida. Kodexemplet nedan visar hur man infogar en bild i en Visio-ritning och sparar som 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); |
Infoga bild i PDF
Aspose.Diagram for .NET API tillåter utvecklare att infoga en bildform på en sida. Kodexemplet nedan visar hur man infogar en bild i en Visio-ritning och sparar som 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); |
Infoga bild i HTML
Aspose.Diagram for .NET API tillåter utvecklare att infoga en bildform på en sida. Kodexemplet nedan visar hur man infogar en bild i en Visio-ritning och sparar som 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()); |