一、示例
package com.xl.poi;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileOutputStream;
import javax.imageio.ImageIO;
import org.apache.poi.hssf.usermodel.HSSFClientAnchor;
import org.apache.poi.hssf.usermodel.HSSFPatriarch;
import org.apache.poi.hssf.usermodel.HSSFSheet;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
public class PoiImageTst {
public static void main(String[] args) throws Exception {
System.out.println("Start...");
/**
* 准备一张插入图片
* 本地已经存在的 或者 通过AWT包画的
*/
ByteArrayOutputStream baos = new ByteArrayOutputStream();
ImageIO.write(ImageIO.read(new File("F:\\Tst\\miansh.png")), "png", baos);
/**
* 创建一个Sheet对象
*/
HSSFWorkbook workbook = new HSSFWorkbook();
HSSFSheet sheet = workbook.createSheet("sheet");
/**
* 画图的顶级容器 当表格为