FillFormat — Aspose.Slides FOSS for Java API Reference
The FillFormat class represents fill formatting properties for shapes. It supports solid, gradient, pattern, and picture fills. It extends PVIObject and implements IFillFormat and IFillParamSource.
Package: org.aspose.slides.foss
import org.aspose.slides.foss.IAutoShape;
import org.aspose.slides.foss.IFillFormat;
import org.aspose.slides.foss.FillType;
import org.aspose.slides.foss.ShapeType;public class FillFormat extends PVIObject implements IFillFormat, IFillParamSourceProperties
| Property | Type | Access | Description |
|---|---|---|---|
getFillType() / setFillType(FillType) | FillType | Read/Write | Fill type (SOLID, GRADIENT, PATTERN, PICTURE, NO_FILL). |
getSolidFillColor() | IColorFormat | Read | Color for solid fills. |
getGradientFormat() | IGradientFormat | Read | Gradient fill properties. |
getPatternFormat() | IPatternFormat | Read | Pattern fill properties. |
getPictureFillFormat() | IPictureFillFormat | Read | Picture fill properties. |
getRotateWithShape() / setRotateWithShape(NullableBool) | NullableBool | Read/Write | Whether the fill rotates with the shape. |
Usage Examples
Solid Fill
import org.aspose.slides.foss.IAutoShape;
import org.aspose.slides.foss.IFillFormat;
import org.aspose.slides.foss.FillType;
import org.aspose.slides.foss.ShapeType;
import java.awt.Color;
IAutoShape shape = slide.getShapes().addAutoShape(
ShapeType.RECTANGLE, 50, 50, 200, 100);
IFillFormat fill = shape.getFillFormat();
fill.setFillType(FillType.SOLID);
fill.getSolidFillColor().setColor(Color.RED);No Fill (Transparent)
shape.getFillFormat().setFillType(FillType.NO_FILL);