PictureFill Class
A picture fill that uses an image as the fill pattern.
Declaration
public class PictureFill extends Fill
Remarks
The following code snippet uses the PictureFill class to fill a slide background with an image:
import com.devexpress.docs.presentation.*;
import com.devexpress.docs.office.*;
import com.devexpress.system.drawing.Color;
SlideLayout slideLayout = new SlideLayout(SlideLayoutType.BLANK, "slide");
Slide slide = new Slide(slideLayout);
try (InputStream stream = Files.newInputStream(Path.of("D:\\image.png"))) {
PictureFill fill = new PictureFill(DXImage.fromStream(stream));
fill.setStretch(true);
slide.setBackground(new CustomSlideBackground(fill));
}
For more information on how to customize the slide or shape fill, refer to the following help topics:
Inherited Members
Inheritance
PictureFill(DXImage image)
Initializes a new instance of the PictureFill class with specified settings.
Declaration
public PictureFill(DXImage image)
Parameters
| Name | Type | Description |
|---|---|---|
| image | DXImage | Specifies the image used for the picture fill. |
Methods
deepClone() Method
Returns a deep copy of this PictureFill instance.
Declaration
public PictureFill deepClone()
Returns
| Type | Description |
|---|---|
PictureFill |
A deep copy of this |
getAlignType() Method
Returns the position of the first tile relative to the shape to which the tiled picture fill is applied.
Declaration
public TileAlignType getAlignType()
Returns
| Type | Description |
|---|---|
| TileAlignType | The alignment type of the first tile relative to the shape. |
getFillRect() Method
Returns the rectangle area where the picture fill is applied.
Declaration
public RectangleOffset getFillRect()
Returns
| Type | Description |
|---|---|
| RectangleOffset | The rectangle area where the picture fill is applied. |
getFlipType() Method
Returns how the picture fill is flipped when tiled.
Declaration
public FlipType getFlipType()
Returns
| Type | Description |
|---|---|
| FlipType | Flipping mode. |
getImage() Method
Returns the image used as the fill.
Declaration
public OfficeImageBase getImage()
Returns
| Type | Description |
|---|---|
| OfficeImageBase | The image used as the fill. |
getOffsetX() Method
Returns the horizontal offset of the picture fill.
Declaration
public float getOffsetX()
Returns
| Type | Description |
|---|---|
| float | The horizontal offset of the picture fill. |
getOffsetY() Method
Returns the vertical offset of the picture fill.
Declaration
public float getOffsetY()
Returns
| Type | Description |
|---|---|
| float | The vertical offset of the picture fill. |
getRotateWithShape() Method
Indicates whether the picture fill rotates along with the shape.
Declaration
public boolean getRotateWithShape()
Returns
| Type | Description |
|---|---|
| boolean | Indicates whether the picture fill rotates along with the shape. |
getScaleX() Method
Returns the horizontal scaling factor of the picture fill. 100.0f means original width; values larger than 100.0f enlarge, values smaller than 100.0f shrink.
Declaration
public float getScaleX()
Returns
| Type | Description |
|---|---|
| float | The horizontal scaling factor of the picture fill. |
getScaleY() Method
Returns the vertical scaling factor of the picture fill. 100.0f means original height; values larger than 100.0f enlarge, values smaller than 100.0f shrink.
Declaration
public float getScaleY()
Returns
| Type | Description |
|---|---|
| float | The vertical scaling factor of the picture fill. |
getSourceRect() Method
Returns the part of the picture to display in the document.
Declaration
public RectangleOffset getSourceRect()
Returns
| Type | Description |
|---|---|
| RectangleOffset | An object that specifies offsets (in percentage) from the edges of a shape’s bounding box to the center. |
getStretch() Method
Indicates whether the picture fill is stretched when tiled.
Declaration
public boolean getStretch()
Returns
| Type | Description |
|---|---|
| boolean |
|
getType() Method
Returns the fill type.
Declaration
public FillType getType()
Returns
| Type | Description |
|---|---|
| FillType | The fill type. |
setAlignType(TileAlignType value) Method
Sets the position of the first tile relative to the shape to which the tiled picture fill is applied.
Declaration
public void setAlignType(TileAlignType value)
Parameters
| Name | Type | Description |
|---|---|---|
| value | TileAlignType | The alignment type of the first tile relative to the shape. |
setFillRect(RectangleOffset value) Method
Sets the rectangle area where the picture fill is applied.
Declaration
public void setFillRect(RectangleOffset value)
Parameters
| Name | Type | Description |
|---|---|---|
| value | RectangleOffset | The rectangle area where the picture fill is applied. |
setFlipType(FlipType value) Method
Sets how the picture fill is flipped when tiled.
Declaration
public void setFlipType(FlipType value)
Parameters
| Name | Type | Description |
|---|---|---|
| value | FlipType | Flipping mode. |
setOffsetX(float value) Method
Sets the horizontal offset of the picture fill.
Declaration
public void setOffsetX(float value)
Parameters
| Name | Type | Description |
|---|---|---|
| value | float | The horizontal offset of the picture fill. |
setOffsetY(float value) Method
Sets the vertical offset of the picture fill.
Declaration
public void setOffsetY(float value)
Parameters
| Name | Type | Description |
|---|---|---|
| value | float | The vertical offset of the picture fill. |
setRotateWithShape(boolean value) Method
Indicates whether the picture fill rotates along with the shape.
Declaration
public void setRotateWithShape(boolean value)
Parameters
| Name | Type | Description |
|---|---|---|
| value | boolean | Indicates whether the picture fill rotates along with the shape. |
setScaleX(float value) Method
Sets the horizontal scaling factor of the picture fill. 100.0f means original width; values larger than 100.0f enlarge, values smaller than 100.0f shrink.
Declaration
public void setScaleX(float value)
Parameters
| Name | Type | Description |
|---|---|---|
| value | float | The horizontal scaling factor of the picture fill. |
setScaleY(float value) Method
Sets the vertical scaling factor of the picture fill. 100.0f means original height; values larger than 100.0f enlarge, values smaller than 100.0f shrink.
Declaration
public void setScaleY(float value)
Parameters
| Name | Type | Description |
|---|---|---|
| value | float | The vertical scaling factor of the picture fill. |
setSourceRect(RectangleOffset value) Method
Specifies the part of the picture to display in the document.
Declaration
public void setSourceRect(RectangleOffset value)
Parameters
| Name | Type | Description |
|---|---|---|
| value | RectangleOffset | An object that specifies offsets (in percentage) from the edges of a shape’s bounding box to the center. |
setStretch(boolean value) Method
Indicates whether the picture fill is stretched when tiled.
Declaration
public void setStretch(boolean value)
Parameters
| Name | Type | Description |
|---|---|---|
| value | boolean |
|