c# - 有没有办法将位图列表保存到 word 或 excel 文件中
问题描述
我有这个对象的列表:
public class SerialMatrix
{
public string SerialNumber { get; set; }
public Image DataMatrix { get; set; }
}
有没有办法用该列表填充 word/excel 文件?
问题是要使用 DocX 插入图像,您需要提供图像的 url,并且我们在对象列表中有位图图像
我已经尝试将每个图像保存到特定路径中,然后每次都读取它,但是尝试覆盖每个图像并将其保存到同一个文档时出现问题。
foreach (var item in serialNumbers)
{
dataImage = GenerateMatrix(item); //here I generate the datamatrix
objeto.SerialNumber = item; //add the serialnumber to the object
objeto.DataMatrix = dataImage; //add the image(bitmap) to the object
objectlist.Add(objeto); //add the object to my list of objects
}
解决方案
推荐阅读
- google-people-api - 访问其他联系人组信息
- java - keytool 错误:java.lang.Exception:输入不是 X.509 证书(再次)
- javascript - 在条件问答表单中添加下一步按钮
- javascript - 如何在本地运行?
- core-data - SwiftUI 核心数据预览不能跨平台工作
- java - 如何在 Spring Batch 中为 JSON 文件创建阅读器
- reactjs - ReactJS + Firestore - 使用文档分页似乎不起作用
- google-bigquery - BigQuery 存储过程以什么用户身份运行?
- twitter-bootstrap - 只有其他所有链接在 Bootstrap 5 弹出窗口中都能正常工作
- html - 在部分内随机排序/排序项目