GetEffective
FillFormat.GetEffective method
获取应用继承的有效填充格式数据。
public IFillFormatEffectiveData GetEffective()
返回值
例子
此示例演示如何获取形状的有效填充格式属性。
[C#]
using (Presentation pres = new Presentation(@"MyPresentation.pptx"))
{
IFillFormatEffectiveData effectiveFillFormat = pres.Slides[0].Shapes[0].FillFormat.GetEffective();
Console.WriteLine("Type: " + effectiveFillFormat.FillType);
switch (effectiveFillFormat.FillType)
{
case FillType.Solid:
Console.WriteLine("Fill color: " + effectiveFillFormat.SolidFillColor);
break;
case FillType.Pattern:
Console.WriteLine("Pattern style: " + effectiveFillFormat.PatternFormat.PatternStyle);
Console.WriteLine("Fore color: " + effectiveFillFormat.PatternFormat.ForeColor);
Console.WriteLine("Back color: " + effectiveFillFormat.PatternFormat.BackColor);
break;
case FillType.Gradient:
Console.WriteLine("Gradient direction: " + effectiveFillFormat.GradientFormat.GradientDirection);
Console.WriteLine("Gradient stops count: " + effectiveFillFormat.GradientFormat.GradientStops.Count);
break;
case FillType.Picture:
Console.WriteLine("Picture width: " + effectiveFillFormat.PictureFillFormat.Picture.Image.Width);
Console.WriteLine("Picture height: " + effectiveFillFormat.PictureFillFormat.Picture.Image.Height);
break;
}
}
也可以看看
- interface IFillFormatEffectiveData
- class FillFormat
- 命名空间 Aspose.Slides
- 部件 Aspose.Slides