GetEffective

EffectFormat.GetEffective 方法

获取应用继承的有效效果格式数据。

public IEffectFormatEffectiveData GetEffective()

返回值

一个 IEffectFormatEffectiveData

示例

这个示例演示了如何获取某个形状的有效效果属性。

[C#]
using (Presentation pres = new Presentation(@"MyPresentation.pptx"))
{
	IEffectFormatEffectiveData effectiveEffectFormat = pres.Slides[0].Shapes[0].EffectFormat.GetEffective();

	if (effectiveEffectFormat.IsNoEffects)
	{
		Console.WriteLine("该形状没有应用效果。");
	}
	else
	{
		if (effectiveEffectFormat.BlurEffect != null)
			Console.WriteLine("模糊效果半径: " + effectiveEffectFormat.BlurEffect.Radius);
		if (effectiveEffectFormat.FillOverlayEffect != null)
			Console.WriteLine("填充覆盖效果填充类型: " + effectiveEffectFormat.FillOverlayEffect.FillFormat.FillType);
		if (effectiveEffectFormat.GlowEffect != null)
			Console.WriteLine("发光效果颜色: " + effectiveEffectFormat.GlowEffect.Color);
		if (effectiveEffectFormat.InnerShadowEffect != null)
			Console.WriteLine("内阴影效果阴影颜色: " + effectiveEffectFormat.InnerShadowEffect.ShadowColor);
		if (effectiveEffectFormat.OuterShadowEffect != null)
			Console.WriteLine("外阴影效果阴影颜色: " + effectiveEffectFormat.OuterShadowEffect.ShadowColor);
		if (effectiveEffectFormat.PresetShadowEffect != null)
			Console.WriteLine("预设阴影效果阴影颜色: " + effectiveEffectFormat.PresetShadowEffect.ShadowColor);
		if (effectiveEffectFormat.ReflectionEffect != null)
			Console.WriteLine("反射效果距离: " + effectiveEffectFormat.ReflectionEffect.Distance);
		if (effectiveEffectFormat.SoftEdgeEffect != null)
			Console.WriteLine("柔和边缘效果半径: " + effectiveEffectFormat.SoftEdgeEffect.Radius);
	}
}

另请参阅