我有一个 Base64 编码的字符串,我希望将其转换为图像并使用 DocumentFormat.openXML 将其绘制在 word 文档中
作为常规二进制图像。对于获取字节,请使用 Convert.FromBase64String(theBase64string)
,对于流,请使用 MemoryStream
:
using(var m = new MemoryStream(Convert.FromBase64String(theBase64string)))
{
//here, same code to insert regular binary images
}