java.lang.Object
com.aspose.words.Fill
public class Fill
Use the Although the Example:
DocumentBuilder builder = new DocumentBuilder();
builder.writeln();
builder.writeln();
builder.writeln();
builder.write("Some text under the shape.");
// Create a red balloon, semitransparent.
// The shape is floating and its coordinates are (0,0) by default, relative to the current paragraph.
Shape shape = new Shape(builder.getDocument(), ShapeType.BALLOON);
shape.setFillColor(Color.RED);
shape.getFill().setOpacity(0.3);
shape.setWidth(100);
shape.setHeight(100);
shape.setTop(-100);
builder.insertNode(shape);
builder.getDocument().save(getMyDir() + "Shape.Fill Out.doc");
| Property Getters/Setters Summary | ||
|---|---|---|
java.awt.Color | getColor() | |
void | setColor(java.awt.Color value) | |
| Defines the color of a fill. | ||
byte[] | getImageBytes() | |
| Gets the raw bytes of the fill texture or pattern. | ||
boolean | getOn() | |
void | setOn(boolean value) | |
| Determines whether the shape will be filled. | ||
double | getOpacity() | |
void | setOpacity(double value) | |
| Defines the transparency of a fill. Valid range from 0 to 1, where 0 is fully transparent and 1 is fully opaque. | ||
| Property Getters/Setters Detail |
|---|
getColor/setColor | |
public java.awt.Color getColor() / public void setColor(java.awt.Color value) | |
The default value is
getImageBytes | |
public byte[] getImageBytes() | |
The default value is null.
getOn/setOn | |
public boolean getOn() / public void setOn(boolean value) | |
The default value is true.
getOpacity/setOpacity | |
public double getOpacity() / public void setOpacity(double value) | |
The default value is 1.
Example:
Demonstrates how to create shapes with fill.
DocumentBuilder builder = new DocumentBuilder();
builder.writeln();
builder.writeln();
builder.writeln();
builder.write("Some text under the shape.");
// Create a red balloon, semitransparent.
// The shape is floating and its coordinates are (0,0) by default, relative to the current paragraph.
Shape shape = new Shape(builder.getDocument(), ShapeType.BALLOON);
shape.setFillColor(Color.RED);
shape.getFill().setOpacity(0.3);
shape.setWidth(100);
shape.setHeight(100);
shape.setTop(-100);
builder.insertNode(shape);
builder.getDocument().save(getMyDir() + "Shape.Fill Out.doc");