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, IFillFormatInheritance
PVIObject → FillFormat
Properties
| Property | Type | Access | Description |
|---|---|---|---|
FillType | FillType | Read | Active fill type (Solid, Gradient, Pattern, Picture, NoFill). |
SolidFillColor | IColorFormat | Read | Color used for solid fills. |
GradientFormat | IGradientFormat | Read | Gradient fill settings. |
PatternFormat | IPatternFormat | Read | Pattern fill settings. |
PictureFillFormat | IPictureFillFormat | Read | Picture fill settings. |
RotateWithShape | NullableBool | Read | Whether 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;
}