/** * @return the anchor that is used by this shape. */ @Override public XSSFClientAnchor getClientAnchor() { XSSFAnchor a = getAnchor(); return (a instanceof XSSFClientAnchor) ? (XSSFClientAnchor)a : null; }
@Override public XSSFAnchor getAnchor() { return _picture.getAnchor(); }
/** * @return the anchor that is used by this shape. */ @Override public XSSFClientAnchor getClientAnchor() { XSSFAnchor a = getAnchor(); return (a instanceof XSSFClientAnchor) ? (XSSFClientAnchor)a : null; }
@Override public XSSFAnchor getAnchor() { return _picture.getAnchor(); }
XSSFClientAnchor anchor = (XSSFClientAnchor)getAnchor();
/** * Reset the image to the original size. * <p> * Please note, that this method works correctly only for workbooks * with the default font size (Calibri 11pt for .xlsx). * If the default font is changed the resized image can be streched vertically or horizontally. * </p> * * @param scale the amount by which image dimensions are multiplied relative to the original size. * <code>resize(1.0)</code> sets the original size, <code>resize(0.5)</code> resize to 50% of the original, * <code>resize(2.0)</code> resizes to 200% of the original. */ public void resize(double scale){ XSSFClientAnchor anchor = (XSSFClientAnchor)getAnchor(); XSSFClientAnchor pref = getPreferredSize(scale); int row2 = anchor.getRow1() + (pref.getRow2() - pref.getRow1()); int col2 = anchor.getCol1() + (pref.getCol2() - pref.getCol1()); anchor.setCol2(col2); anchor.setDx1(0); anchor.setDx2(pref.getDx2()); anchor.setRow2(row2); anchor.setDy1(0); anchor.setDy2(pref.getDy2()); }