POI 3.2图像高度/宽度控制 [英] POI 3.2 Image Height/Width controlling
问题描述
使用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.
稍后我通过调用
sheet.setColumnWidth(columnindex,columnwidth)来调整excel文件的列的大小
图像损失其原始高度/宽度。
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屋!