int dx2 = (int)(Units.EMU_PER_PIXEL * (cw - deltaW)); anchor.setCol2(col2); anchor.setDx2(dx2);
int col2 = anchor.getCol1() + (pref.getCol2() - pref.getCol1()); anchor.setCol2(col2);
/** * 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. */ @Override public void resize(double scale){ XSSFClientAnchor anchor = getClientAnchor(); XSSFClientAnchor pref = getPreferredSize(scale); if (anchor == null || pref == null) { logger.log(POILogger.WARN, "picture is not anchored via client anchor - ignoring resize call"); return; } 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()); }
int pictureIndex=wb.addPicture(bytes, pictureFormat); anchor.setCol1(i); anchor.setCol2(i+colSpan); anchor.setRow1(rowNumber); anchor.setRow2(rowNumber+rowSpan); int pictureIndex=wb.addPicture(bytes, pictureFormat); anchor.setCol1(i); anchor.setCol2(i+colSpan); anchor.setRow1(rowNumber); anchor.setRow2(rowNumber+rowSpan); int pictureIndex=wb.addPicture(bytes, pictureFormat); anchor.setCol1(i); anchor.setCol2(i+colSpan); anchor.setRow1(rowNumber); anchor.setRow2(rowNumber+rowSpan); int pictureIndex=wb.addPicture(bytes, pictureFormat); anchor.setCol1(i); anchor.setCol2(i+colSpan); anchor.setRow1(rowNumber); anchor.setRow2(rowNumber+rowSpan);
int pictureIndex=wb.addPicture(bytes, pictureFormat); anchor.setCol1(i); anchor.setCol2(i+colSpan); anchor.setRow1(rowNumber); anchor.setRow2(rowNumber+rowSpan); int pictureIndex=wb.addPicture(bytes, pictureFormat); anchor.setCol1(i); anchor.setCol2(i+colSpan); anchor.setRow1(rowNumber); anchor.setRow2(rowNumber+rowSpan);
int pictureIndex=wb.addPicture(bytes, pictureFormat); anchor.setCol1(i); anchor.setCol2(i+colSpan); anchor.setRow1(rowNumber); anchor.setRow2(rowNumber+rowSpan); int pictureIndex=wb.addPicture(bytes, pictureFormat); anchor.setCol1(i); anchor.setCol2(i+colSpan); anchor.setRow1(rowNumber); anchor.setRow2(rowNumber+rowSpan);
int pictureIndex=wb.addPicture(bytes, pictureFormat); anchor.setCol1(i); anchor.setCol2(i+colSpan); anchor.setRow1(rowNumber); anchor.setRow2(rowNumber+rowSpan); int pictureIndex=wb.addPicture(bytes, pictureFormat); anchor.setCol1(i); anchor.setCol2(i+colSpan); anchor.setRow1(rowNumber); anchor.setRow2(rowNumber+rowSpan); int pictureIndex=wb.addPicture(bytes, pictureFormat); anchor.setCol1(i); anchor.setCol2(i+colSpan); anchor.setRow1(rowNumber); anchor.setRow2(rowNumber+rowSpan); int pictureIndex=wb.addPicture(bytes, pictureFormat); anchor.setCol1(i); anchor.setCol2(i+colSpan); anchor.setRow1(rowNumber); anchor.setRow2(rowNumber+rowSpan);
int pictureIndex=wb.addPicture(bytes, pictureFormat); anchor.setCol1(i); anchor.setCol2(i+colSpan); anchor.setRow1(rowNumber); anchor.setRow2(rowNumber+rowSpan); int pictureIndex=wb.addPicture(bytes, pictureFormat); anchor.setCol1(i); anchor.setCol2(i+colSpan); anchor.setRow1(rowNumber); anchor.setRow2(rowNumber+rowSpan);
int pictureIndex=wb.addPicture(bytes, pictureFormat); anchor.setCol1(i); anchor.setCol2(i+colSpan); anchor.setRow1(rowNumber); anchor.setRow2(rowNumber+rowSpan); int pictureIndex=wb.addPicture(bytes, pictureFormat); anchor.setCol1(i); anchor.setCol2(i+colSpan); anchor.setRow1(rowNumber); anchor.setRow2(rowNumber+rowSpan);
dx2 = (int)(EMU_PER_PIXEL*(cw-delta)); anchor.setCol2(col2); anchor.setDx2(dx2);
int dx2 = (int)(Units.EMU_PER_PIXEL * (cw - deltaW)); anchor.setCol2(col2); anchor.setDx2(dx2);
/** * 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()); }
int col2 = anchor.getCol1() + (pref.getCol2() - pref.getCol1()); anchor.setCol2(col2);
/** * 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. */ @Override public void resize(double scale){ XSSFClientAnchor anchor = getClientAnchor(); XSSFClientAnchor pref = getPreferredSize(scale); if (anchor == null || pref == null) { logger.log(POILogger.WARN, "picture is not anchored via client anchor - ignoring resize call"); return; } 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()); }