FillFormat

IBulletFormatEffectiveData.FillFormat 属性

返回段落的项目符号填充格式。只读 IFillFormatEffectiveData

public IFillFormatEffectiveData FillFormat { get; }

示例

此示例演示了如何检索项目符号的填充有效数据。

[C#]
using (Presentation pres = new Presentation("SomePresentation.pptx"))
{
    // 假设第一张幻灯片上的第一个形状是带有一些文本的自动形状...
    // 输出有关文本段落项目符号的信息
    AutoShape autoShape = (AutoShape)pres.Slides[0].Shapes[0];
    foreach (Paragraph para in autoShape.TextFrame.Paragraphs)
    {
        IBulletFormatEffectiveData bulletFormatEffective = para.ParagraphFormat.Bullet.GetEffective();
        Console.WriteLine("项目符号类型: " + bulletFormatEffective.Type);
        if (bulletFormatEffective.Type != BulletType.None)
        {
            Console.WriteLine("项目符号填充类型: " + bulletFormatEffective.FillFormat.FillType);
            switch (bulletFormatEffective.FillFormat.FillType)
            {
                case FillType.Solid:
                    Console.WriteLine("实心填充颜色: " + bulletFormatEffective.FillFormat.SolidFillColor);
                    break;
                case FillType.Gradient:
                    Console.WriteLine("渐变停止数量: " + bulletFormatEffective.FillFormat.GradientFormat.GradientStops.Count);
                    foreach (IGradientStopEffectiveData gradStop in bulletFormatEffective.FillFormat.GradientFormat.GradientStops)
                        Console.WriteLine(gradStop.Position + ": " + gradStop.Color);
                    break;
                case FillType.Pattern:
                    Console.WriteLine("图案样式: " + bulletFormatEffective.FillFormat.PatternFormat.PatternStyle);
                    Console.WriteLine("前景色: " + bulletFormatEffective.FillFormat.PatternFormat.ForeColor);
                    Console.WriteLine("背景色: " + bulletFormatEffective.FillFormat.PatternFormat.BackColor);
                    break;
            }
        }
        Console.WriteLine();
    }
}

另请参见