首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 平面设计 > 图形图像 >

POI中增多image

2013-11-09 
POI中增加image引用:http://poi.apache.org/spreadsheet/quick-guide.html#Images?Images are part of the

POI中增加image

引用:http://poi.apache.org/spreadsheet/quick-guide.html#Images

?

Images are part of the drawing support. To add an image just call?createPicture()?on the drawing patriarch. At the time of writing the following types are supported:

    PNGJPGDIB

    It should be noted that any existing drawings may be erased once you add a image to a sheet.

    WarningPicture.resize() works only for JPEG and PNG. Other formats are not yet supported.

    Reading images from a workbook:

         List lst = workbook.getAllPictures();    for (Iterator it = lst.iterator(); it.hasNext(); ) {        PictureData pict = (PictureData)it.next();        String ext = pict.suggestFileExtension();        byte[] data = pict.getData();        if (ext.equals("jpeg")){          FileOutputStream out = new FileOutputStream("pict.jpg");          out.write(data);          out.close();        }    }http://www.iteye.com/topic/18063 http://pengliyong909.blog.163.com/blog/static/40832036201032735423383/这二个可以参考下。

热点排行