/** * Creates a picture. * * @param anchor the client anchor describes how this picture is attached to the sheet. * @param pictureIndex the index of the picture in the workbook collection of pictures, * {@link XSSFWorkbook#getAllPictures()} . * @return the newly created picture shape. */ public XSSFPicture createPicture(XSSFClientAnchor anchor, int pictureIndex) { PackageRelationship rel = getDrawing().addPictureReference(pictureIndex); CTPicture ctShape = ctGroup.addNewPic(); ctShape.set(XSSFPicture.prototype()); XSSFPicture shape = new XSSFPicture(getDrawing(), ctShape); shape.parent = this; shape.anchor = anchor; shape.setPictureReference(rel); return shape; }
/** * Creates a picture. * * @param anchor * the client anchor describes how this picture is attached to * the sheet. * @param pictureIndex * the index of the picture in the workbook collection of * pictures, * {@link org.apache.poi.xssf.usermodel.XSSFWorkbook#getAllPictures()} * . * * @return the newly created picture shape. */ public XSSFPicture createPicture(XSSFClientAnchor anchor, int pictureIndex) { PackageRelationship rel = addPictureReference(pictureIndex); long shapeId = newShapeId(); CTTwoCellAnchor ctAnchor = createTwoCellAnchor(anchor); CTPicture ctShape = ctAnchor.addNewPic(); ctShape.set(XSSFPicture.prototype()); ctShape.getNvPicPr().getCNvPr().setId(shapeId); XSSFPicture shape = new XSSFPicture(this, ctShape); shape.anchor = anchor; shape.setPictureReference(rel); ctShape.getSpPr().setXfrm(createXfrm(anchor)); return shape; }
/** * Creates a picture. * * @param anchor the client anchor describes how this picture is attached to the sheet. * @param pictureIndex the index of the picture in the workbook collection of pictures, * {@link XSSFWorkbook#getAllPictures()} . * @return the newly created picture shape. */ public XSSFPicture createPicture(XSSFClientAnchor anchor, int pictureIndex) { PackageRelationship rel = getDrawing().addPictureReference(pictureIndex); CTPicture ctShape = ctGroup.addNewPic(); ctShape.set(XSSFPicture.prototype()); XSSFPicture shape = new XSSFPicture(getDrawing(), ctShape); shape.parent = this; shape.anchor = anchor; shape.setPictureReference(rel); return shape; }
/** * Creates a picture. * * @param anchor the client anchor describes how this picture is attached to the sheet. * @param pictureIndex the index of the picture in the workbook collection of pictures, * {@link XSSFWorkbook#getAllPictures()} . * @return the newly created picture shape. */ public XSSFPicture createPicture(XSSFClientAnchor anchor, int pictureIndex) { PackageRelationship rel = getDrawing().addPictureReference(pictureIndex); CTPicture ctShape = ctGroup.addNewPic(); ctShape.set(XSSFPicture.prototype()); XSSFPicture shape = new XSSFPicture(getDrawing(), ctShape); shape.parent = this; shape.anchor = anchor; shape.setPictureReference(rel); return shape; }
/** * Creates a picture. * * @param anchor the client anchor describes how this picture is attached to the sheet. * @param pictureIndex the index of the picture in the workbook collection of pictures, * {@link org.apache.poi.xssf.usermodel.XSSFWorkbook#getAllPictures()} . * * @return the newly created picture shape. */ public XSSFPicture createPicture(XSSFClientAnchor anchor, int pictureIndex) { PackageRelationship rel = addPictureReference(pictureIndex); long shapeId = newShapeId(); CTTwoCellAnchor ctAnchor = createTwoCellAnchor(anchor); CTPicture ctShape = ctAnchor.addNewPic(); ctShape.set(XSSFPicture.prototype()); ctShape.getNvPicPr().getCNvPr().setId(shapeId); XSSFPicture shape = new XSSFPicture(this, ctShape); shape.anchor = anchor; shape.setPictureReference(rel); return shape; }
/** * Creates a picture. * * @param anchor * the client anchor describes how this picture is attached to * the sheet. * @param pictureIndex * the index of the picture in the workbook collection of * pictures, * {@link org.apache.poi.xssf.usermodel.XSSFWorkbook#getAllPictures()} * . * * @return the newly created picture shape. */ public XSSFPicture createPicture(XSSFClientAnchor anchor, int pictureIndex) { PackageRelationship rel = addPictureReference(pictureIndex); long shapeId = newShapeId(); CTTwoCellAnchor ctAnchor = createTwoCellAnchor(anchor); CTPicture ctShape = ctAnchor.addNewPic(); ctShape.set(XSSFPicture.prototype()); ctShape.getNvPicPr().getCNvPr().setId(shapeId); XSSFPicture shape = new XSSFPicture(this, ctShape); shape.anchor = anchor; shape.setPictureReference(rel); ctShape.getSpPr().setXfrm(createXfrm(anchor)); return shape; }