Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/excel/29.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C#EPPlus(或OpenXml)将Excel形状保存为图像_C#_Excel_Openxml_Epplus - Fatal编程技术网

C#EPPlus(或OpenXml)将Excel形状保存为图像

C#EPPlus(或OpenXml)将Excel形状保存为图像,c#,excel,openxml,epplus,C#,Excel,Openxml,Epplus,我想从Excel文件中提取所有可视对象(现在是图像和形状) 使用图片很容易,因为它们具有图像属性。 是否可以将形状保存为图像文件 int i = 0; foreach (ExcelDrawing item in workSheet.Drawings) { i++; var pic = item as ExcelPicture; var shp = (item as ExcelShape); pic?.Image?.Save($@"C:\MyFile{i}.jpg

我想从Excel文件中提取所有可视对象(现在是图像和形状)

使用图片很容易,因为它们具有图像属性。 是否可以将形状保存为图像文件

int i = 0;
foreach (ExcelDrawing item in workSheet.Drawings)
{
    i++;
    var pic = item as ExcelPicture;
    var shp = (item as ExcelShape);
    pic?.Image?.Save($@"C:\MyFile{i}.jpg");
    if (shp != null) {
    // how can I save the shape?
    }
}