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, IFillParamSource

Properties

PropertyTypeAccessDescription
getFillType() / setFillType(FillType)FillTypeRead/WriteFill type (SOLID, GRADIENT, PATTERN, PICTURE, NO_FILL).
getSolidFillColor()IColorFormatReadColor for solid fills.
getGradientFormat()IGradientFormatReadGradient fill properties.
getPatternFormat()IPatternFormatReadPattern fill properties.
getPictureFillFormat()IPictureFillFormatReadPicture fill properties.
getRotateWithShape() / setRotateWithShape(NullableBool)NullableBoolRead/WriteWhether 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);

See Also