POI 3.2 图像高度/宽度控制 [英] POI 3.2 Image Height/Width controlling

查看:25
本文介绍了POI 3.2 图像高度/宽度控制的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用 POI 3.2 版

Using POI version 3.2

问题:无法将图像大小调整为其原始高度和宽度.我可以将图像添加到 excel 文件中.

Issue: Not able to resize an image to its original height and width. I am able to add an image to the excel file.

添加图像后我调用picture.resize();方法.

After adding image I call picture.resize(); method.

后来我通过调用调整excel文件的列大小sheet.setColumnWidth(columnindex, columnwidth)图像丢失其原始高度/宽度.

Later I resize the columns of the excel file by calling sheet.setColumnWidth(columnindex, columnwidth) the image losses its original height/width.

请帮忙.

推荐答案

我发现你不能在 sheet.autoSizeColumn(i) 之后调用 picture.resize()> 即使您没有在图片锚定到的列上调用 autoSizeColumn(i).

I found that you must NOT call picture.resize() until after sheet.autoSizeColumn(i) even if you are not calling autoSizeColumn(i) on the column to which the picture is anchored.

这篇关于POI 3.2 图像高度/宽度控制的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆