FillFormat — Aspose.Slides FOSS for .NET API Reference

The FillFormat class controls how a shape, text, or table cell is filled. It supports solid color, gradient, pattern, and picture fill modes.

Package: Aspose.Slides.Foss (net9.0)

using Aspose.Slides.Foss;
public class FillFormat : PVIObject, IFillFormat

Inheritance

PVIObjectFillFormat


Properties

PropertyTypeAccessDescription
FillTypeFillTypeReadActive fill type (Solid, Gradient, Pattern, Picture, NoFill).
SolidFillColorIColorFormatReadColor used for solid fills.
GradientFormatIGradientFormatReadGradient fill settings.
PatternFormatIPatternFormatReadPattern fill settings.
PictureFillFormatIPictureFillFormatReadPicture fill settings.
RotateWithShapeNullableBoolReadWhether the fill rotates with the shape.

Usage Examples

Read Fill Information

using Aspose.Slides.Foss;

using var prs = new Presentation("deck.pptx");
var shape = prs.Slides[0].Shapes[0];
var fill = shape.FillFormat;

Console.WriteLine($"Fill type: {fill.FillType}");
switch (fill.FillType)
{
    case FillType.Solid:
        Console.WriteLine($"  Color: {fill.SolidFillColor.Color}");
        break;
    case FillType.Gradient:
        Console.WriteLine($"  Stops: {fill.GradientFormat.GradientStops.Count}");
        break;
    case FillType.Pattern:
        Console.WriteLine($"  Style: {fill.PatternFormat.PatternStyle}");
        break;
}

See Also