poi-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Amigo <et_s...@mail.ru>
Subject Image stretched while insert in xls
Date Sat, 30 Nov 2013 12:47:36 GMT
Hello all.

Trying insert image into xls file. In resulted xls, image a little bit
stretched.

   private static void insertImage(org.apache.poi.ss.usermodel.Workbook
workbook, HSSFCell cell, byte[] imgBytes, int pictureType) {
        int pictureIdx = workbook.addPicture(imgBytes, pictureType);
        CreationHelper helper = workbook.getCreationHelper();
        Drawing drawing = workbook.getSheetAt(0).createDrawingPatriarch();
        ClientAnchor anchor = helper.createClientAnchor();
        anchor.setCol1(cell.getColumnIndex());
        anchor.setRow1(cell.getRowIndex());
        anchor.setAnchorType(ClientAnchor.MOVE_DONT_RESIZE  );
        Picture pict = drawing.createPicture(anchor, pictureIdx);
        pict.resize();
    }

I am read about Picture.resize() problem method (it works only on Arial
font). How i can set thisFont to my xls file or make work for other fonts
size?
How to solve problem with stretched image? 



--
View this message in context: http://apache-poi.1045710.n5.nabble.com/Image-stretched-while-insert-in-xls-tp5714373.html
Sent from the POI - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
For additional commands, e-mail: user-help@poi.apache.org


Mime
View raw message