public final class PictureFillFormat extends PVIObject implements IPictureFillFormat
Represents a picture fill style.
| Modifier and Type | Method and Description |
|---|---|
boolean |
compressImage(boolean deleteCroppedAreasOfImage,
float resolution)
Compresses the image by reducing its size based on the shape size and specified resolution.
|
boolean |
compressImage(boolean deleteCroppedAreasOfImage,
int resolution)
Compresses the image by reducing its size based on the shape size and specified resolution.
|
IPPImage |
deletePictureCroppedAreas()
Delete cropped areas of the fill Picture.
|
float |
getCropBottom()
Returns or sets the number of percents of real image height that are cropped off
the bottom of the picture.
|
float |
getCropLeft()
Returns or sets the number of percents of real image width that are cropped off
the left of the picture.
|
float |
getCropRight()
Returns or sets the number of percents of real image width that are cropped off
the right of the picture.
|
float |
getCropTop()
Returns or sets the number of percents of real image height that are cropped off
the top of the picture.
|
int |
getDpi()
Returns or sets the dpi which is used to fill a picture.
|
ISlidesPicture |
getPicture()
Returns the picture.
|
int |
getPictureFillMode()
Returns or sets the picture fill mode.
|
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.
|
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.
|
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.
|
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.
|
byte |
getTileAlignment()
Returns or sets how the texture is aligned within the shape.
|
int |
getTileFlip()
Flips the texture tile around its horizontal, vertical or both axis.
|
float |
getTileOffsetX()
Returns or sets the horizontal offset of the texture from the shape's origin in points.
|
float |
getTileOffsetY()
Returns or sets the vertical offset of the texture from the shape's origin in points.
|
float |
getTileScaleX()
Returns or sets the horizontal scale for the texture fill as a percentage.
|
float |
getTileScaleY()
Returns or sets the vertical scale for the texture fill as a percentage.
|
long |
getVersion()
Version.
|
void |
setCropBottom(float value)
Returns or sets the number of percents of real image height that are cropped off
the bottom of the picture.
|
void |
setCropLeft(float value)
Returns or sets the number of percents of real image width that are cropped off
the left of the picture.
|
void |
setCropRight(float value)
Returns or sets the number of percents of real image width that are cropped off
the right of the picture.
|
void |
setCropTop(float value)
Returns or sets the number of percents of real image height that are cropped off
the top of the picture.
|
void |
setDpi(int value)
Returns or sets the dpi which is used to fill a picture.
|
void |
setPictureFillMode(int value)
Returns or sets the picture fill mode.
|
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.
|
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.
|
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.
|
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.
|
void |
setTileAlignment(byte value)
Returns or sets how the texture is aligned within the shape.
|
void |
setTileFlip(int value)
Flips the texture tile around its horizontal, vertical or both axis.
|
void |
setTileOffsetX(float value)
Returns or sets the horizontal offset of the texture from the shape's origin in points.
|
void |
setTileOffsetY(float value)
Returns or sets the vertical offset of the texture from the shape's origin in points.
|
void |
setTileScaleX(float value)
Returns or sets the horizontal scale for the texture fill as a percentage.
|
void |
setTileScaleY(float value)
Returns or sets the vertical scale for the texture fill as a percentage.
|
equals, getParent_Immediate, getParent_IPresentationComponent, getParent_ISlideComponent, getPresentation, getSlide, hashCodepublic long getVersion()
Version.
Read-only long.
getVersion in class PVIObjectpublic final int getDpi()
Returns or sets the dpi which is used to fill a picture.
Read/write int.
getDpi in interface IPictureFillFormatpublic final void setDpi(int value)
Returns or sets the dpi which is used to fill a picture.
Read/write int.
setDpi in interface IPictureFillFormatpublic final int getPictureFillMode()
Returns or sets the picture fill mode.
Read/write PictureFillMode.
getPictureFillMode in interface IPictureFillFormatpublic final void setPictureFillMode(int value)
Returns or sets the picture fill mode.
Read/write PictureFillMode.
setPictureFillMode in interface IPictureFillFormatpublic final ISlidesPicture getPicture()
Returns the picture.
Read-only ISlidesPicture.
getPicture in interface IPictureFillFormatpublic 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.
getCropLeft in interface IPictureFillFormatpublic 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.
setCropLeft in interface IPictureFillFormatpublic 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.
getCropTop in interface IPictureFillFormatpublic 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.
setCropTop in interface IPictureFillFormatpublic 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.
getCropRight in interface IPictureFillFormatpublic 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.
setCropRight in interface IPictureFillFormatpublic 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.
getCropBottom in interface IPictureFillFormatpublic 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.
setCropBottom in interface IPictureFillFormatpublic 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(); }
deletePictureCroppedAreas in interface IPictureFillFormatpublic final boolean compressImage(boolean deleteCroppedAreasOfImage,
int 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 theCompressImagemethod 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); 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, PicturesCompression.Dpi150); } finally { if (presentation != null) presentation.dispose(); }
compressImage in interface IPictureFillFormatdeleteCroppedAreasOfImage - If true, the method will remove the cropped areas of the image, potentially further reducing its size.resolution - The target resolution for compression, specified as a value of the PicturesCompression enum.
com.aspose.ms.System.ArgumentException - Thrown when the resolution is not a valid value.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 theCompressImagemethod 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(); }
compressImage in interface IPictureFillFormatdeleteCroppedAreasOfImage - If true, the method will remove the cropped areas of the image, potentially further reducing its size.resolution - The target resolution in DPI. This value must be positive and defines how the image will be resized.
boolean indicating whether the image was successfully compressed. Returns if the image was resized or cropped, otherwise .com.aspose.ms.System.ArgumentException - Thrown when the resolution is not a positive value.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.
getStretchOffsetLeft in interface IPictureFillFormatpublic 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.
setStretchOffsetLeft in interface IPictureFillFormatpublic 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.
getStretchOffsetTop in interface IPictureFillFormatpublic 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.
setStretchOffsetTop in interface IPictureFillFormatpublic 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.
getStretchOffsetRight in interface IPictureFillFormatpublic 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.
setStretchOffsetRight in interface IPictureFillFormatpublic 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.
getStretchOffsetBottom in interface IPictureFillFormatpublic 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.
setStretchOffsetBottom in interface IPictureFillFormatpublic 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(); }
getTileOffsetX in interface IPictureFillFormatpublic 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(); }
setTileOffsetX in interface IPictureFillFormatpublic 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(); }
getTileOffsetY in interface IPictureFillFormatpublic 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(); }
setTileOffsetY in interface IPictureFillFormatpublic 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(); }
getTileScaleX in interface IPictureFillFormatpublic 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(); }
setTileScaleX in interface IPictureFillFormatpublic 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(); }
getTileScaleY in interface IPictureFillFormatpublic 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(); }
setTileScaleY in interface IPictureFillFormatpublic 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(); }
RectangleAlignment.TopLeft.
getTileAlignment in interface IPictureFillFormatpublic 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(); }
RectangleAlignment.TopLeft.
setTileAlignment in interface IPictureFillFormatpublic 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(); }
TileFlip.NoFlip.
getTileFlip in interface IPictureFillFormatpublic 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(); }
TileFlip.NoFlip.
setTileFlip in interface IPictureFillFormatCopyright © 2004-2025 Aspose Pty Ltd. All Rights Reserved.