forked from fanruan/easyexcel
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
37 lines
863 B
37 lines
863 B
5 years ago
|
package com.alibaba.easyexcel.test.demo.write;
|
||
|
|
||
|
import java.io.File;
|
||
|
import java.io.InputStream;
|
||
|
import java.net.URL;
|
||
|
|
||
|
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;
|
||
|
|
||
|
/**
|
||
|
* 图片导出类
|
||
|
*
|
||
|
*/
|
||
|
@Data
|
||
|
@ContentRowHeight(100)
|
||
|
@ColumnWidth(100 / 8)
|
||
|
public class ImageDataWithAnnotation {
|
||
|
private File file;
|
||
|
private InputStream inputStream;
|
||
|
/**
|
||
|
* 如果string类型 必须指定转换器,string默认转换成string
|
||
|
*/
|
||
|
@ExcelProperty(converter = StringImageConverter.class)
|
||
|
private String string;
|
||
|
private byte[] byteArray;
|
||
|
/**
|
||
|
* 根据url导出
|
||
|
*
|
||
|
* @since 2.1.1
|
||
|
*/
|
||
|
private URL url;
|
||
|
}
|