Tag: image

C#&OpenXML:将图像插入到Excel文档中

我正在使用此代码的修改版本来创build一个Excel文档,添加单元格和样式单元格。 我试图修改这个代码也能够添加图像到工作表。 我无处可去,networking上真的没有任何东西可以帮到你。 我正在尝试通读OpenXML生产力工具diff。 这是一种无益的。 任何人都可以指出我正确的方向吗? 谢谢。

将图片添加到Excel单元格时,Apache POI-HSSF扭曲图像大小

我使用Apache POI-HSSF将图片添加到单元格中。 图像是120×100,但无论我做什么和如何调整它,Excel电子表格总是显示它跨越多行,并扭曲它的高度比宽度高得多。 我如何保持原来的大小? 我的代码: InputStream is = new FileInputStream(getImageURL()); byte[] bytes = IOUtils.toByteArray(is); int pictureIdx = wb.addPicture(bytes, Workbook.PICTURE_TYPE_JPEG); is.close(); //add a picture shape CreationHelper helper = wb.getCreationHelper(); ClientAnchor anchor = helper.createClientAnchor(); // Create the drawing patriarch. This is the top level container for all shapes. Drawing drawing = sheet1.createDrawingPatriarch(); //set top-left corner of the […]

将图像添加到iphone中的Excel表格

在我的应用程序,我想从数据库检索数据,并将其添加到Excel表格。 数据库的数据是string和BLOB格式。 我已经检索数据并添加到使用框架的Excel表: https : //github.com/andreac/RSSheet 问题是我想要将图像添加到工作表中。 如果任何人有任何想法,请帮助我。

Apache POI插入图像

我正在插入一个图片在excel表im正在制作的麻烦。 关于这个问题有很多问题,但我根本搞不清楚我做错了什么。 我的代码运行,显示没有错误,但我没有看到一个图像插入:( 这里是代码: InputStream is = new FileInputStream("nasuto_tlo.png"); byte [] bytes = IOUtils.toByteArray(is); int pictureIndex = wb.addPicture(bytes, Workbook.PICTURE_TYPE_PNG); is.close(); CreationHelper helper = wb.getCreationHelper(); Drawing drawingPatriarch = sheet.createDrawingPatriarch(); ClientAnchor anchor = helper.createClientAnchor(); anchor.setCol1(2); anchor.setRow1(3); Picture pict = drawingPatriarch.createPicture(anchor, pictureIndex); pict.resize(); try { FileOutputStream out = new FileOutputStream(root+"/Busotina/Busotina1.xls"); wb.write(out); out.close(); } catch (Exception e) { e.printStackTrace(); […]