GetEffective

FillFormat.GetEffective метод

Получает данные об эффективном заполнении формата с применением наследования.

public IFillFormatEffectiveData GetEffective()

Возвращаемое значение

IFillFormatEffectiveData.

Примеры

Этот пример демонстрирует получение свойств эффективного формата заполнения фигуры.

[C#]
using (Presentation pres = new Presentation(@"MyPresentation.pptx"))
{
	IFillFormatEffectiveData effectiveFillFormat = pres.Slides[0].Shapes[0].FillFormat.GetEffective();

	Console.WriteLine("Тип: " + effectiveFillFormat.FillType);
	switch (effectiveFillFormat.FillType)
	{
		case FillType.Solid:
			Console.WriteLine("Цвет заполнения: " + effectiveFillFormat.SolidFillColor);
			break;
		case FillType.Pattern:
			Console.WriteLine("Стиль узора: " + effectiveFillFormat.PatternFormat.PatternStyle);
			Console.WriteLine("Цвет переднего плана: " + effectiveFillFormat.PatternFormat.ForeColor);
			Console.WriteLine("Цвет фона: " + effectiveFillFormat.PatternFormat.BackColor);
			break;
		case FillType.Gradient:
			Console.WriteLine("Направление градиента: " + effectiveFillFormat.GradientFormat.GradientDirection);
			Console.WriteLine("Количество градиентных остановок: " + effectiveFillFormat.GradientFormat.GradientStops.Count);
			break;
		case FillType.Picture:
			Console.WriteLine("Ширина картинки: " + effectiveFillFormat.PictureFillFormat.Picture.Image.Width);
			Console.WriteLine("Высота картинки: " + effectiveFillFormat.PictureFillFormat.Picture.Image.Height);
			break;
	}
}

Смотрите также