将图像粘贴到C#中指定的Excel单元格中? [解决了] [英] Paste image in a specified excel cell in C#? [Solved]

查看:98
本文介绍了将图像粘贴到C#中指定的Excel单元格中? [解决了]的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



如何通过C#过去excel工作表的Cell [5,3]中的图像?



请如果您对此知之甚少或者您不确定,请不要表达您的意见。

不要发送任何其他链接谷歌搜索,因为互联网上有很多不工作的例子。

Thx。

Hi,
How can I past an image in Cell[5,3] of an excel worksheet by C#?

Please Do NOT express your opinion if you have not enough knowledge about it or you are not sure about that.
Please Do NOT send any other link searched by google, because there are a lot of non working example on the Internet.
Thx.

推荐答案

:thumbsup:

我可以解决它:

:thumbsup:
I could solve it:
Excel.Range oRange = (Excel.Range)xlWorkSheet1.Cells[Row, 1];
float Left =(float) ((double)oRange.Left);
float Top =(float) ((double)oRange.Top);
const float ImageSize=32;
xlWorkSheet1.Shapes.AddPicture(imagString, Microsoft.Office.Core.MsoTriState.msoFalse, Microsoft.Office.Core.MsoTriState.msoCTrue, Left, Top, ImageSize, ImageSize);
oRange.RowHeight = ImageSize + 2;


这篇关于将图像粘贴到C#中指定的Excel单元格中? [解决了]的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆