使用例子
public class testJxl {
public static void main(String[] args) throws Exception {
OutputStream out = new FileOutputStream("./aaaa.xls"); // 写入到
FileInputStream
WritableWorkbook wwb= Workbook.createWorkbook(out);
WritableSheet ws1=wwb.createSheet("test1", 0) ; // 得到工作薄中的第一个工作表
File fileImg = new File("./kkkk.bmp");
byte imageData[] = new byte[(int)fileImg.length()];
FileInputStream fis = new FileInputStream(fileImg);
fis.read(imageData);
// must be 24 bit true-colour,bmp file
// * @param imageByte
// * @param widthPixel
// * @param heightPixel
ws1.setWaterMarkImage(imageData,459,142);
wwb.write();
wwb.close();
fis.close();
out.close();
}
}
1