forked from fanruan/easyexcel
zhuangjiaju
5 years ago
4 changed files with 116 additions and 2 deletions
After Width: | Height: | Size: 8.8 KiB |
@ -0,0 +1,30 @@
|
||||
package com.alibaba.easyexcel.test.demo.write; |
||||
|
||||
import java.io.File; |
||||
import java.io.InputStream; |
||||
|
||||
import com.alibaba.excel.annotation.ExcelProperty; |
||||
import com.alibaba.excel.annotation.write.style.ColumnWidth; |
||||
import com.alibaba.excel.annotation.write.style.ContentRowHeight; |
||||
import com.alibaba.excel.converters.string.StringImageConverter; |
||||
|
||||
import lombok.Data; |
||||
|
||||
/** |
||||
* 图片导出类 |
||||
* |
||||
* @author Jiaju Zhuang |
||||
*/ |
||||
@Data |
||||
@ContentRowHeight(100) |
||||
@ColumnWidth(100 / 8) |
||||
public class ImageData { |
||||
private File file; |
||||
private InputStream inputStream; |
||||
/** |
||||
* 如果string类型 必须指定转换器,string默认转换成string |
||||
*/ |
||||
@ExcelProperty(converter = StringImageConverter.class) |
||||
private String string; |
||||
private byte[] byteArray; |
||||
} |
Loading…
Reference in new issue