for (POIXMLDocumentPart dr : sheet.getRelations()) {
if (dr instanceof XSSFDrawing) {
XSSFDrawing drawing = (XSSFDrawing) dr;
List<XSSFShape> shapes = drawing.getShapes();
for (XSSFShape shape : shapes) {
XSSFPicture pic = (XSSFPicture) shape;
XSSFClientAnchor anchor = pic.getPreferredSize();
anchor.setAnchorType(ClientAnchor.AnchorType.MOVE_AND_RESIZE);
CTMarker ctMarker = anchor.getFrom();
ctMarker.setRow(ctMarker.getRow() + 1);
pic.resize();
}
}
}
原文:http://www.cnblogs.com/wangtg/p/7806304.html