PictureFillFormat
Inheritance: java.lang.Object, com.aspose.slides.PVIObject
All Implemented Interfaces: com.aspose.slides.IPictureFillFormat
public final class PictureFillFormat extends PVIObject implements IPictureFillFormat
Represents a picture fill style.
Methods
Method | Description |
---|---|
getVersion() | |
getDpi() | Returns or sets the dpi which is used to fill a picture. |
setDpi(int value) | Returns or sets the dpi which is used to fill a picture. |
getPictureFillMode() | Returns or sets the picture fill mode. |
setPictureFillMode(int value) | Returns or sets the picture fill mode. |
getPicture() | Returns the picture. |
getCropLeft() | Returns or sets the number of percents of real image width that are cropped off the left of the picture. |
setCropLeft(float value) | Returns or sets the number of percents of real image width that are cropped off the left of the picture. |
getCropTop() | Returns or sets the number of percents of real image height that are cropped off the top of the picture. |
setCropTop(float value) | Returns or sets the number of percents of real image height that are cropped off the top of the picture. |
getCropRight() | Returns or sets the number of percents of real image width that are cropped off the right of the picture. |
setCropRight(float value) | Returns or sets the number of percents of real image width that are cropped off the right of the picture. |
getCropBottom() | Returns or sets the number of percents of real image height that are cropped off the bottom of the picture. |
setCropBottom(float value) | Returns or sets the number of percents of real image height that are cropped off the bottom of the picture. |
deletePictureCroppedAreas() | Delete cropped areas of the fill Picture. |
compressImage(boolean deleteCroppedAreasOfImage, float resolution) | Compresses the image by reducing its size based on the shape size and specified resolution. |
getStretchOffsetLeft() | Returns or sets left edge of the fill rectangle that is defined by a percentage offset from the left edge of the shape’s bounding box. |
setStretchOffsetLeft(float value) | Returns or sets left edge of the fill rectangle that is defined by a percentage offset from the left edge of the shape’s bounding box. |
getStretchOffsetTop() | Returns or sets top edge of the fill rectangle that is defined by a percentage offset from the top edge of the shape’s bounding box. |
setStretchOffsetTop(float value) | Returns or sets top edge of the fill rectangle that is defined by a percentage offset from the top edge of the shape’s bounding box. |
getStretchOffsetRight() | Returns or sets right edge of the fill rectangle that is defined by a percentage offset from the right edge of the shape’s bounding box. |
setStretchOffsetRight(float value) | Returns or sets right edge of the fill rectangle that is defined by a percentage offset from the right edge of the shape’s bounding box. |
getStretchOffsetBottom() | Returns or sets bottom edge of the fill rectangle that is defined by a percentage offset from the bottom edge of the shape’s bounding box. |
setStretchOffsetBottom(float value) | Returns or sets bottom edge of the fill rectangle that is defined by a percentage offset from the bottom edge of the shape’s bounding box. |
getTileOffsetX() | Returns or sets the horizontal offset of the texture from the shape’s origin in points. |
setTileOffsetX(float value) | Returns or sets the horizontal offset of the texture from the shape’s origin in points. |
getTileOffsetY() | Returns or sets the vertical offset of the texture from the shape’s origin in points. |
setTileOffsetY(float value) | Returns or sets the vertical offset of the texture from the shape’s origin in points. |
getTileScaleX() | Returns or sets the horizontal scale for the texture fill as a percentage. |
setTileScaleX(float value) | Returns or sets the horizontal scale for the texture fill as a percentage. |
getTileScaleY() | Returns or sets the vertical scale for the texture fill as a percentage. |
setTileScaleY(float value) | Returns or sets the vertical scale for the texture fill as a percentage. |
getTileAlignment() | Returns or sets how the texture is aligned within the shape. |
setTileAlignment(byte value) | Returns or sets how the texture is aligned within the shape. |
getTileFlip() | Flips the texture tile around its horizontal, vertical or both axis. |
setTileFlip(int value) | Flips the texture tile around its horizontal, vertical or both axis. |
getVersion()
public long getVersion()
Version. Read-only long.
Returns: long
getDpi()
public final int getDpi()
Returns or sets the dpi which is used to fill a picture. Read/write int .
Returns: int
setDpi(int value)
public final void setDpi(int value)
Returns or sets the dpi which is used to fill a picture. Read/write int .
Parameters:
Parameter | Type | Description |
---|---|---|
value | int |
getPictureFillMode()
public final int getPictureFillMode()
Returns or sets the picture fill mode. Read/write PictureFillMode.
Returns: int
setPictureFillMode(int value)
public final void setPictureFillMode(int value)
Returns or sets the picture fill mode. Read/write PictureFillMode.
Parameters:
Parameter | Type | Description |
---|---|---|
value | int |
getPicture()
public final ISlidesPicture getPicture()
Returns the picture. Read-only ISlidesPicture.
Returns: ISlidesPicture
getCropLeft()
public final float getCropLeft()
Returns or sets the number of percents of real image width that are cropped off the left of the picture. Read/write float .
Returns: float
setCropLeft(float value)
public final void setCropLeft(float value)
Returns or sets the number of percents of real image width that are cropped off the left of the picture. Read/write float .
Parameters:
Parameter | Type | Description |
---|---|---|
value | float |
getCropTop()
public final float getCropTop()
Returns or sets the number of percents of real image height that are cropped off the top of the picture. Read/write float .
Returns: float
setCropTop(float value)
public final void setCropTop(float value)
Returns or sets the number of percents of real image height that are cropped off the top of the picture. Read/write float .
Parameters:
Parameter | Type | Description |
---|---|---|
value | float |
getCropRight()
public final float getCropRight()
Returns or sets the number of percents of real image width that are cropped off the right of the picture. Read/write float .
Returns: float
setCropRight(float value)
public final void setCropRight(float value)
Returns or sets the number of percents of real image width that are cropped off the right of the picture. Read/write float .
Parameters:
Parameter | Type | Description |
---|---|---|
value | float |
getCropBottom()
public final float getCropBottom()
Returns or sets the number of percents of real image height that are cropped off the bottom of the picture. Read/write float .
Returns: float
setCropBottom(float value)
public final void setCropBottom(float value)
Returns or sets the number of percents of real image height that are cropped off the bottom of the picture. Read/write float .
Parameters:
Parameter | Type | Description |
---|---|---|
value | float |
deletePictureCroppedAreas()
public final IPPImage deletePictureCroppedAreas()
Delete cropped areas of the fill Picture.
Presentation presentation = new Presentation("demo.pptx"); try { ISlide slide = presentation.getSlides().get_Item(0); // Gets the PictureFrame IPictureFrame picFrame = (IPictureFrame)slide.getShapes().get_Item(0); // Deletes cropped areas of the PictureFrame image IPPImage croppedImage = picFrame.getPictureFormat().deletePictureCroppedAreas(); } finally { if (presentation != null) presentation.dispose(); }
Returns: IPPImage - Cropped image or origin image if cropping is not necessary.
This method converts WMF/EMF metafiles to raster PNG image while cropping.
compressImage(boolean deleteCroppedAreasOfImage, float resolution)
public final boolean compressImage(boolean deleteCroppedAreasOfImage, float resolution)
Compresses the image by reducing its size based on the shape size and specified resolution. Optionally, it also deletes cropped areas.
The following example demonstrates how to use the ``` CompressImage ``` method to reduce the size of an image in a presentation by setting a target resolution and removing cropped areas: Presentation presentation = new Presentation("demo.pptx"); try { ISlide slide = presentation.getSlides().get_Item(0); // Gets the PictureFrame IPictureFrame picFrame = (IPictureFrame)slide.getShapes().get_Item(0); // Compress the image with a target resolution of 150 DPI (Web resolution) and remove cropped areas boolean result = picFrame.getPictureFormat().compressImage(true, 150f); // Web resolution } finally { if (presentation != null) presentation.dispose(); }
Parameters:
Parameter | Type | Description |
---|---|---|
deleteCroppedAreasOfImage | boolean | If true, the method will remove the cropped areas of the image, potentially further reducing its size. |
resolution | float | The target resolution in DPI. This value must be positive and defines how the image will be resized. |
This method changes the image’s size and resolution similar to PowerPoint’s “Picture Format -> Compress Pictures” feature. |
Returns: boolean - A boolean indicating whether the image was successfully compressed. Returns if the image was resized or cropped, otherwise .
getStretchOffsetLeft()
public final float getStretchOffsetLeft()
Returns or sets left edge of the fill rectangle that is defined by a percentage offset from the left edge of the shape’s bounding box. A positive percentage specifies an inset, while a negative percentage specifies an outset. Read/write float .
Returns: float
setStretchOffsetLeft(float value)
public final void setStretchOffsetLeft(float value)
Returns or sets left edge of the fill rectangle that is defined by a percentage offset from the left edge of the shape’s bounding box. A positive percentage specifies an inset, while a negative percentage specifies an outset. Read/write float .
Parameters:
Parameter | Type | Description |
---|---|---|
value | float |
getStretchOffsetTop()
public final float getStretchOffsetTop()
Returns or sets top edge of the fill rectangle that is defined by a percentage offset from the top edge of the shape’s bounding box. A positive percentage specifies an inset, while a negative percentage specifies an outset. Read/write float .
Returns: float
setStretchOffsetTop(float value)
public final void setStretchOffsetTop(float value)
Returns or sets top edge of the fill rectangle that is defined by a percentage offset from the top edge of the shape’s bounding box. A positive percentage specifies an inset, while a negative percentage specifies an outset. Read/write float .
Parameters:
Parameter | Type | Description |
---|---|---|
value | float |
getStretchOffsetRight()
public final float getStretchOffsetRight()
Returns or sets right edge of the fill rectangle that is defined by a percentage offset from the right edge of the shape’s bounding box. A positive percentage specifies an inset, while a negative percentage specifies an outset. Read/write float .
Returns: float
setStretchOffsetRight(float value)
public final void setStretchOffsetRight(float value)
Returns or sets right edge of the fill rectangle that is defined by a percentage offset from the right edge of the shape’s bounding box. A positive percentage specifies an inset, while a negative percentage specifies an outset. Read/write float .
Parameters:
Parameter | Type | Description |
---|---|---|
value | float |
getStretchOffsetBottom()
public final float getStretchOffsetBottom()
Returns or sets bottom edge of the fill rectangle that is defined by a percentage offset from the bottom edge of the shape’s bounding box. A positive percentage specifies an inset, while a negative percentage specifies an outset. Read/write float .
Returns: float
setStretchOffsetBottom(float value)
public final void setStretchOffsetBottom(float value)
Returns or sets bottom edge of the fill rectangle that is defined by a percentage offset from the bottom edge of the shape’s bounding box. A positive percentage specifies an inset, while a negative percentage specifies an outset. Read/write float .
Parameters:
Parameter | Type | Description |
---|---|---|
value | float |
getTileOffsetX()
public final float getTileOffsetX()
Returns or sets the horizontal offset of the texture from the shape’s origin in points. A positive value moves the texture to the right, while a negative value moves it to the left. Read/write float .
Presentation presentation = new Presentation("demo.pptx"); try { ISlide slide = presentation.getSlides().get_Item(0); // Gets the picture fill format of the shape IPictureFillFormat pictureFillFormat = slide.getShapes().get_Item(0).getFillFormat().getPictureFillFormat(); // Sets the picture fill mode to Tile pictureFillFormat.setPictureFillMode(PictureFillMode.Tile); // Sets the horizontal offset of the texture to 20 points pictureFillFormat.setTileOffsetX(20f); } finally { if (presentation != null) presentation.dispose(); }
Returns: float
setTileOffsetX(float value)
public final void setTileOffsetX(float value)
Returns or sets the horizontal offset of the texture from the shape’s origin in points. A positive value moves the texture to the right, while a negative value moves it to the left. Read/write float .
Presentation presentation = new Presentation("demo.pptx"); try { ISlide slide = presentation.getSlides().get_Item(0); // Gets the picture fill format of the shape IPictureFillFormat pictureFillFormat = slide.getShapes().get_Item(0).getFillFormat().getPictureFillFormat(); // Sets the picture fill mode to Tile pictureFillFormat.setPictureFillMode(PictureFillMode.Tile); // Sets the horizontal offset of the texture to 20 points pictureFillFormat.setTileOffsetX(20f); } finally { if (presentation != null) presentation.dispose(); }
Parameters:
Parameter | Type | Description |
---|---|---|
value | float |
getTileOffsetY()
public final float getTileOffsetY()
Returns or sets the vertical offset of the texture from the shape’s origin in points. A positive value moves the texture down, while a negative value moves it up. Read/write float .
Presentation presentation = new Presentation("demo.pptx"); try { ISlide slide = presentation.getSlides().get_Item(0); // Gets the picture fill format of the shape IPictureFillFormat pictureFillFormat = slide.getShapes().get_Item(0).getFillFormat().getPictureFillFormat(); // Sets the picture fill mode to Tile pictureFillFormat.setPictureFillMode(PictureFillMode.Tile); // Sets the vertical offset of the texture to -50 points pictureFillFormat.setTileOffsetY(-50); } finally { if (presentation != null) presentation.dispose(); }
Returns: float
setTileOffsetY(float value)
public final void setTileOffsetY(float value)
Returns or sets the vertical offset of the texture from the shape’s origin in points. A positive value moves the texture down, while a negative value moves it up. Read/write float .
Presentation presentation = new Presentation("demo.pptx"); try { ISlide slide = presentation.getSlides().get_Item(0); // Gets the picture fill format of the shape IPictureFillFormat pictureFillFormat = slide.getShapes().get_Item(0).getFillFormat().getPictureFillFormat(); // Sets the picture fill mode to Tile pictureFillFormat.setPictureFillMode(PictureFillMode.Tile); // Sets the vertical offset of the texture to -50 points pictureFillFormat.setTileOffsetY(-50); } finally { if (presentation != null) presentation.dispose(); }
Parameters:
Parameter | Type | Description |
---|---|---|
value | float |
getTileScaleX()
public final float getTileScaleX()
Returns or sets the horizontal scale for the texture fill as a percentage. Read/write float .
Presentation presentation = new Presentation("demo.pptx"); try { ISlide slide = presentation.getSlides().get_Item(0); // Gets the picture fill format of the shape IPictureFillFormat pictureFillFormat = slide.getShapes().get_Item(0).getFillFormat().getPictureFillFormat(); // Sets the picture fill mode to Tile pictureFillFormat.setPictureFillMode(PictureFillMode.Tile); // Sets the horizontal scale for the texture to 120 percents pictureFillFormat.setTileScaleX(120); } finally { if (presentation != null) presentation.dispose(); }
Returns: float
setTileScaleX(float value)
public final void setTileScaleX(float value)
Returns or sets the horizontal scale for the texture fill as a percentage. Read/write float .
Presentation presentation = new Presentation("demo.pptx"); try { ISlide slide = presentation.getSlides().get_Item(0); // Gets the picture fill format of the shape IPictureFillFormat pictureFillFormat = slide.getShapes().get_Item(0).getFillFormat().getPictureFillFormat(); // Sets the picture fill mode to Tile pictureFillFormat.setPictureFillMode(PictureFillMode.Tile); // Sets the horizontal scale for the texture to 120 percents pictureFillFormat.setTileScaleX(120); } finally { if (presentation != null) presentation.dispose(); }
Parameters:
Parameter | Type | Description |
---|---|---|
value | float |
getTileScaleY()
public final float getTileScaleY()
Returns or sets the vertical scale for the texture fill as a percentage. Read/write float .
Presentation presentation = new Presentation("demo.pptx"); try { ISlide slide = presentation.getSlides().get_Item(0); // Gets the picture fill format of the shape IPictureFillFormat pictureFillFormat = slide.getShapes().get_Item(0).getFillFormat().getPictureFillFormat(); // Sets the picture fill mode to Tile pictureFillFormat.setPictureFillMode(PictureFillMode.Tile); // Sets the vertical scale for the texture to 120 percents pictureFillFormat.setTileScaleY(120); } finally { if (presentation != null) presentation.dispose(); }
Returns: float
setTileScaleY(float value)
public final void setTileScaleY(float value)
Returns or sets the vertical scale for the texture fill as a percentage. Read/write float .
Presentation presentation = new Presentation("demo.pptx"); try { ISlide slide = presentation.getSlides().get_Item(0); // Gets the picture fill format of the shape IPictureFillFormat pictureFillFormat = slide.getShapes().get_Item(0).getFillFormat().getPictureFillFormat(); // Sets the picture fill mode to Tile pictureFillFormat.setPictureFillMode(PictureFillMode.Tile); // Sets the vertical scale for the texture to 120 percents pictureFillFormat.setTileScaleY(120); } finally { if (presentation != null) presentation.dispose(); }
Parameters:
Parameter | Type | Description |
---|---|---|
value | float |
getTileAlignment()
public final byte getTileAlignment()
Returns or sets how the texture is aligned within the shape. This setting controls the starting point of the texture pattern and how it repeats across the shape. Read/write RectangleAlignment.
Presentation presentation = new Presentation("demo.pptx"); try { ISlide slide = presentation.getSlides().get_Item(0); // Gets the picture fill format of the shape IPictureFillFormat pictureFillFormat = slide.getShapes().get_Item(0).getFillFormat().getPictureFillFormat(); // Sets the picture fill mode to Tile pictureFillFormat.setPictureFillMode(PictureFillMode.Tile); // Sets the alignment for the tiling to the right bottom pictureFillFormat.setTileAlignment(RectangleAlignment.BottomRight); } finally { if (presentation != null) presentation.dispose(); }
Default is RectangleAlignment.TopLeft.
Returns: byte
setTileAlignment(byte value)
public final void setTileAlignment(byte value)
Returns or sets how the texture is aligned within the shape. This setting controls the starting point of the texture pattern and how it repeats across the shape. Read/write RectangleAlignment.
Presentation presentation = new Presentation("demo.pptx"); try { ISlide slide = presentation.getSlides().get_Item(0); // Gets the picture fill format of the shape IPictureFillFormat pictureFillFormat = slide.getShapes().get_Item(0).getFillFormat().getPictureFillFormat(); // Sets the picture fill mode to Tile pictureFillFormat.setPictureFillMode(PictureFillMode.Tile); // Sets the alignment for the tiling to the right bottom pictureFillFormat.setTileAlignment(RectangleAlignment.BottomRight); } finally { if (presentation != null) presentation.dispose(); }
Default is RectangleAlignment.TopLeft.
Parameters:
Parameter | Type | Description |
---|---|---|
value | byte |
getTileFlip()
public final int getTileFlip()
Flips the texture tile around its horizontal, vertical or both axis. Read/write TileFlip.
Presentation presentation = new Presentation("demo.pptx"); try { ISlide slide = presentation.getSlides().get_Item(0); // Gets the picture fill format of the shape IPictureFillFormat pictureFillFormat = slide.getShapes().get_Item(0).getFillFormat().getPictureFillFormat(); // Sets the picture fill mode to Tile pictureFillFormat.setPictureFillMode(PictureFillMode.Tile); // Flips the texture tile around its vertical axis. pictureFillFormat.setTileFlip(TileFlip.FlipY); } finally { if (presentation != null) presentation.dispose(); }
Default is TileFlip.NoFlip.
Returns: int
setTileFlip(int value)
public final void setTileFlip(int value)
Flips the texture tile around its horizontal, vertical or both axis. Read/write TileFlip.
Presentation presentation = new Presentation("demo.pptx"); try { ISlide slide = presentation.getSlides().get_Item(0); // Gets the picture fill format of the shape IPictureFillFormat pictureFillFormat = slide.getShapes().get_Item(0).getFillFormat().getPictureFillFormat(); // Sets the picture fill mode to Tile pictureFillFormat.setPictureFillMode(PictureFillMode.Tile); // Flips the texture tile around its vertical axis. pictureFillFormat.setTileFlip(TileFlip.FlipY); } finally { if (presentation != null) presentation.dispose(); }
Default is TileFlip.NoFlip.
Parameters:
Parameter | Type | Description |
---|---|---|
value | int |