Изменить свойства слоя
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); |