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

   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.setAnchorType(ClientAnchor.MOVE_DONT_RESIZE  );
        Picture pict = drawing.createPicture(anchor, pictureIdx);

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
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

View raw message