IPictureFillFormat

All Implemented Interfaces: com.aspose.slides.IFillParamSource

public interface IPictureFillFormat extends IFillParamSource

Represents a picture fill style.

Methods

MethodDescription
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.
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.
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.
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.

getDpi()

public abstract int getDpi()

Returns or sets the dpi which is used to fill a picture. Read/write int.

Returns: int

setDpi(int value)

public abstract void setDpi(int value)

Returns or sets the dpi which is used to fill a picture. Read/write int.

Parameters:

ParameterTypeDescription
valueint

getPictureFillMode()

public abstract int getPictureFillMode()

Returns or sets the picture fill mode. Read/write PictureFillMode.

Returns: int

setPictureFillMode(int value)

public abstract void setPictureFillMode(int value)

Returns or sets the picture fill mode. Read/write PictureFillMode.

Parameters:

ParameterTypeDescription
valueint

getPicture()

public abstract ISlidesPicture getPicture()

Returns the picture. Read-only ISlidesPicture.

Returns: ISlidesPicture

getCropLeft()

public abstract 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 abstract 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:

ParameterTypeDescription
valuefloat

getCropTop()

public abstract 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 abstract 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:

ParameterTypeDescription
valuefloat

getCropRight()

public abstract 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 abstract 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:

ParameterTypeDescription
valuefloat

getCropBottom()

public abstract 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 abstract 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:

ParameterTypeDescription
valuefloat

getStretchOffsetLeft()

public abstract 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 abstract 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:

ParameterTypeDescription
valuefloat

getStretchOffsetTop()

public abstract 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 abstract 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:

ParameterTypeDescription
valuefloat

getStretchOffsetRight()

public abstract 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 abstract 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:

ParameterTypeDescription
valuefloat

getStretchOffsetBottom()

public abstract 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 abstract 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:

ParameterTypeDescription
valuefloat

deletePictureCroppedAreas()

public abstract 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 abstract 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:

ParameterTypeDescription
deleteCroppedAreasOfImagebooleanIf true, the method will remove the cropped areas of the image, potentially further reducing its size.
resolutionfloatThe 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 true if the image was resized or cropped, otherwise false.

getTileOffsetX()

public abstract 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 abstract 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:

ParameterTypeDescription
valuefloat

getTileOffsetY()

public abstract 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 abstract 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:

ParameterTypeDescription
valuefloat

getTileScaleX()

public abstract 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 abstract 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:

ParameterTypeDescription
valuefloat

getTileScaleY()

public abstract 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 abstract 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:

ParameterTypeDescription
valuefloat

getTileAlignment()

public abstract 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 abstract 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:

ParameterTypeDescription
valuebyte

getTileFlip()

public abstract 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 abstract 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:

ParameterTypeDescription
valueint