更改图层属性
Contents
[
Hide
]
在 Visio 中更改图层属性
Aspose.Diagram for .NET允许在 Microsoft Office Visio diagram 中更改图层的属性。每个形状都可以属于多个图层,因此开发人员可以更改图层的属性以满足最终用户的需求。这页表类对象提供图层,允许在 Visio 绘图中添加和删除图层对象。用户可以管理层以编程方式使用 Aspose.Diagram API 的属性如下:
更改层属性编程示例
以下代码有助于更改层的属性。
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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_Layers(); | |
// Load a source Visio diagram | |
Diagram diagram = new Diagram(dataDir + "Drawing1.vsdx"); | |
// Get page by name | |
Page page = diagram.Pages.GetPage("Page-1"); | |
// Iterate through the layers | |
foreach (Aspose.Diagram.Layer layer in Page.PageSheet.Layers) | |
{ | |
layer.Visible.Value = Aspose.Diagram.BOOL.True; | |
layer.Print.Value = Aspose.Diagram.BOOL.True; | |
} | |
// Save diagram | |
diagram.Save(dataDir + "ChangeLayerProperty_out.vsdx", SaveFileFormat.VSDX); |