int dy2 = 0; h = getRowHeightInPixels(sheet,row2++); if (isHSSF) { h *= 1 - anchor.getDy1()/256d; h += getRowHeightInPixels(sheet,row2++); double ch = getRowHeightInPixels(sheet,--row2); double delta = h - scaledHeight; if (isHSSF) {
int row2 = anchor.getRow1(); h = getRowHeightInPixels(sheet,row2++); if (isHSSF) { h *= 1 - anchor.getDy1()/256d; h += getRowHeightInPixels(sheet,row2++); h += getRowHeightInPixels(sheet,row2) * anchor.getDy2()/256; } else { h += anchor.getDy2()/(double)EMU_PER_PIXEL;
private CTTransform2D createXfrm(XSSFClientAnchor anchor) { CTTransform2D xfrm = CTTransform2D.Factory.newInstance(); CTPoint2D off = xfrm.addNewOff(); off.setX(anchor.getDx1()); off.setY(anchor.getDy1()); XSSFSheet sheet = getSheet(); double widthPx = 0; for (int col = anchor.getCol1(); col < anchor.getCol2(); col++) { widthPx += sheet.getColumnWidthInPixels(col); } double heightPx = 0; for (int row = anchor.getRow1(); row < anchor.getRow2(); row++) { heightPx += ImageUtils.getRowHeightInPixels(sheet, row); } long width = Units.pixelToEMU((int) widthPx); long height = Units.pixelToEMU((int) heightPx); CTPositiveSize2D ext = xfrm.addNewExt(); ext.setCx(width - anchor.getDx1() + anchor.getDx2()); ext.setCy(height - anchor.getDy1() + anchor.getDy2()); // TODO: handle vflip/hflip return xfrm; }
int dy2 = 0; h = getRowHeightInPixels(sheet,row2++); if (isHSSF) { h *= 1 - anchor.getDy1()/256d; h += getRowHeightInPixels(sheet,row2++); double ch = getRowHeightInPixels(sheet,--row2); double delta = h - scaledHeight; if (isHSSF) {
int row2 = anchor.getRow1(); h = getRowHeightInPixels(sheet,row2++); if (isHSSF) { h *= 1 - anchor.getDy1()/256d; h += getRowHeightInPixels(sheet,row2++); h += getRowHeightInPixels(sheet,row2) * anchor.getDy2()/256; } else { h += anchor.getDy2()/(double)EMU_PER_PIXEL;
private CTTransform2D createXfrm(XSSFClientAnchor anchor) { CTTransform2D xfrm = CTTransform2D.Factory.newInstance(); CTPoint2D off = xfrm.addNewOff(); off.setX(anchor.getDx1()); off.setY(anchor.getDy1()); XSSFSheet sheet = getSheet(); double widthPx = 0; for (int col = anchor.getCol1(); col < anchor.getCol2(); col++) { widthPx += sheet.getColumnWidthInPixels(col); } double heightPx = 0; for (int row = anchor.getRow1(); row < anchor.getRow2(); row++) { heightPx += ImageUtils.getRowHeightInPixels(sheet, row); } long width = Units.pixelToEMU((int) widthPx); long height = Units.pixelToEMU((int) heightPx); CTPositiveSize2D ext = xfrm.addNewExt(); ext.setCx(width - anchor.getDx1() + anchor.getDx2()); ext.setCy(height - anchor.getDy1() + anchor.getDy2()); // TODO: handle vflip/hflip return xfrm; }