Package org.apache.poi.xslf.usermodel
Class XSLFPictureShape
java.lang.Object
org.apache.poi.xslf.usermodel.XSLFShape
org.apache.poi.xslf.usermodel.XSLFSimpleShape
org.apache.poi.xslf.usermodel.XSLFPictureShape
- All Implemented Interfaces:
IAdjustableShape,PictureShape<XSLFShape,,XSLFTextParagraph> PlaceableShape<XSLFShape,,XSLFTextParagraph> Shape<XSLFShape,,XSLFTextParagraph> SimpleShape<XSLFShape,XSLFTextParagraph>
@Beta
public class XSLFPictureShape
extends XSLFSimpleShape
implements PictureShape<XSLFShape,XSLFTextParagraph>
Represents a picture shape
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.poi.xslf.usermodel.XSLFShape
XSLFShape.ReparseFactory<T extends XmlObject> -
Field Summary
Fields inherited from interface org.apache.poi.sl.usermodel.PictureShape
FULLY_OPAQUE_ALPHA_VALUE, FULLY_TRANSPARENT_ALPHA_VALUE -
Method Summary
Modifier and TypeMethodDescriptionstatic XSLFPictureShapeaddSvgImage(XSLFSheet sheet, XSLFPictureData svgPic, PictureData.PictureType previewType, Rectangle2D anchor) Convenience method for adding SVG images, which generates the preview imageintgetAlpha()protected org.openxmlformats.schemas.drawingml.x2006.main.CTBlipgetBlip()protected org.openxmlformats.schemas.drawingml.x2006.main.CTBlipFillPropertiesprotected Stringprotected StringgetName()Return the data on the (internal) picture.For an external linked picture, return the last-seen path to the picture.booleanbooleanIs this an internal picture (image data included within the PowerPoint file), or an external linked picture (image lives outside)?booleanbooleanvoidsetPlaceholder(Placeholder placeholder) voidsetSvgImage(XSLFPictureData svgPic) Add a SVG image referenceMethods inherited from class org.apache.poi.xslf.usermodel.XSLFSimpleShape
createHyperlink, getAdjustValue, getAnchor, getFillColor, getFillStyle, getFlipHorizontal, getFlipVertical, getGeometry, getHyperlink, getLineCap, getLineColor, getLineCompound, getLineDash, getLineDecoration, getLineHeadDecoration, getLineHeadLength, getLineHeadWidth, getLinePaint, getLineTailDecoration, getLineTailLength, getLineTailWidth, getLineWidth, getRotation, getShadow, getShapeType, getStrokeStyle, getXfrm, setAnchor, setFillColor, setFlipHorizontal, setFlipVertical, setLineCap, setLineColor, setLineCompound, setLineDash, setLineHeadDecoration, setLineHeadLength, setLineHeadWidth, setLineTailDecoration, setLineTailLength, setLineTailWidth, setLineWidth, setRotation, setShapeType, setStrokeStyleMethods inherited from class org.apache.poi.xslf.usermodel.XSLFShape
draw, fetchShapeProperty, getBgPr, getBgRef, getChild, getCNvPr, getFillPaint, getGrpSpPr, getParent, getPlaceholder, getPlaceholderDetails, getShapeId, getShapeName, getShapeProperties, getSheet, getSpStyle, getXmlObject, isPlaceholder, selectPaint, selectPaint, selectPaint, selectPaint, selectPaint, selectPaint, selectProperty, setParentMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.poi.sl.draw.geom.IAdjustableShape
getAdjustValueMethods inherited from interface org.apache.poi.sl.usermodel.PlaceableShape
getAnchor, getFlipHorizontal, getFlipVertical, getParent, getRotation, getSheet, setAnchor, setFlipHorizontal, setFlipVertical, setRotationMethods inherited from interface org.apache.poi.sl.usermodel.Shape
draw, getAnchor, getParent, getShapeId, getShapeName, getSheetMethods inherited from interface org.apache.poi.sl.usermodel.SimpleShape
createHyperlink, getFillColor, getFillStyle, getGeometry, getHyperlink, getLineDecoration, getPlaceholder, getPlaceholderDetails, getShadow, getShapeType, getStrokeStyle, isPlaceholder, setFillColor, setShapeType, setStrokeStyle
-
Method Details
-
isExternalLinkedPicture
public boolean isExternalLinkedPicture()Is this an internal picture (image data included within the PowerPoint file), or an external linked picture (image lives outside)? -
getPictureData
Return the data on the (internal) picture. For an external linked picture, will return null- Specified by:
getPictureDatain interfacePictureShape<XSLFShape,XSLFTextParagraph>
-
setPlaceholder
- Specified by:
setPlaceholderin interfaceSimpleShape<XSLFShape,XSLFTextParagraph> - Overrides:
setPlaceholderin classXSLFShape- See Also:
-
getPictureLink
For an external linked picture, return the last-seen path to the picture. For an internal picture, returns null. -
getBlipFill
protected org.openxmlformats.schemas.drawingml.x2006.main.CTBlipFillProperties getBlipFill() -
getBlip
protected org.openxmlformats.schemas.drawingml.x2006.main.CTBlip getBlip() -
getBlipLink
-
getBlipId
-
getClipping
- Specified by:
getClippingin interfacePictureShape<XSLFShape,XSLFTextParagraph>
-
getAlpha
public int getAlpha()- Specified by:
getAlphain interfacePictureShape<XSLFShape,XSLFTextParagraph>
-
setSvgImage
Add a SVG image reference- Parameters:
svgPic- a previously imported svg image- Since:
- 4.1.0
-
getAlternativePictureData
- Specified by:
getAlternativePictureDatain interfacePictureShape<XSLFShape,XSLFTextParagraph>
-
getName
- Returns:
- picture name, can be null
- Since:
- 5.1.0
-
setName
- Parameters:
name- picture name- Returns:
- returns true if the name was set
- Since:
- 5.1.0
-
getSvgImage
- Returns:
- SVG image data -- can return null if no SVG image is found
-
addSvgImage
public static XSLFPictureShape addSvgImage(XSLFSheet sheet, XSLFPictureData svgPic, PictureData.PictureType previewType, Rectangle2D anchor) throws IOException Convenience method for adding SVG images, which generates the preview image- Parameters:
sheet- the sheet to addsvgPic- the svg picture to addpreviewType- the preview picture type or null (defaults to PNG) - currently only JPEG,GIF,PNG are allowedanchor- the image anchor (for calculating the preview image size) or null (the preview size is taken from the svg picture bounds)- Throws:
IOException- Since:
- 4.1.0
-
isVideoFile
public boolean isVideoFile()- Returns:
- boolean; true if the picture is a video
- Since:
- 5.2.0
-
getVideoFileLink
- Returns:
- the link ID for the video file
- Since:
- 5.2.0
-
isAudioFile
public boolean isAudioFile()- Returns:
- boolean; true if the picture is an audio
- Since:
- 5.2.4
-
getAudioFileLink
- Returns:
- the link ID for the audio file
- Since:
- 5.2.4
-