使用c#编程在excel中添加图像 [英] add image in excel using c# programing
本文介绍了使用c#编程在excel中添加图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
i希望使用编码在excel表中添加图像,所以我使用下面的方法来做这个并且它工作正常但现在我想以 iTextSharp.text.Image 代替字符串(imagename)所以有可能或以任何方式实现这个目标吗?
i want to add image in excel sheet using coding so i use below method to do this and it''s work fine but now i want to pass image file in format of iTextSharp.text.Image in place of string(imagename) so is it possible or any way to achieve this ?
worksheet.Shapes.AddPicture(string, left, top, width, height);
推荐答案
不,你不能。为什么?请参阅: http:/ /msdn.microsoft.com/en-us/library/microsoft.office.interop.excel.shapes.addpicture%28v=office.11%29.aspx [ ^ ]
将iTextSharp.Text.Image保存为硬盘上的图像,然后将其添加到Excel工作表(传递完整的图像路径)。
No, you can''t. Why? See this: http://msdn.microsoft.com/en-us/library/microsoft.office.interop.excel.shapes.addpicture%28v=office.11%29.aspx[^]
Save iTextSharp.Text.Image as image on hard disk and than add it to Excel sheet (passing full path of image).
这篇关于使用c#编程在excel中添加图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文