获取 Visio 形状继承填充
Contents
[
Hide
]
检索 Visio 形状的继承填充数据
Visio 形状可以继承父样式和主形状。开发者可以获得Visio形状的继承填充数据。 InheritFill 属性,由形状类,包含由父样式和主控形状继承的形状的填充格式值。
检索继承的填充数据编程示例
以下代码片段检索形状的继承填充数据。请检查此示例代码:
This file contains hidden or 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_Shapes(); | |
// Call a Diagram class constructor to load the VSDX diagram | |
Diagram diagram = new Diagram(dataDir + "Drawing1.vsdx"); | |
// Get page by name | |
Page page = diagram.Pages.GetPage("Page-3"); | |
foreach (Aspose.Diagram.Shape shape in page.Shapes) | |
{ | |
Fill f = shape.InheritFill; | |
Console.WriteLine(f.FillForegnd.Value); | |
Console.WriteLine(f.FillPattern.Value); | |
Console.WriteLine(f.ShdwForegnd.Value); | |
Console.WriteLine(f.ShdwPattern.Value); | |
} |