GetEffective

FillFormat.GetEffective method

Gets effective fill formatting data with the inheritance applied.

public IFillFormatEffectiveData GetEffective()

Return Value

A IFillFormatEffectiveData.

Examples

This example demonstrates getting shape’s effective fill format properties.

[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;
	}
}

See Also