将背景图像插入 Excel

在 Microsoft Excel 中设置工作表背景

要在 Microsoft Excel(例如 Microsoft Excel 2019)中设置工作表的背景图像:

  1. 来自页面布局菜单,找到页面设置选项,然后单击背景选项。

  2. 选择一张图片以设置工作表的背景图片。

    设置工作表背景

待办事项:图片_替代_文本

使用 Aspose.Cells 设置工作表背景

下面的代码使用流中的图像设置背景图像。

// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-.NET
// Create a new Workbook.
Workbook workbook = new Workbook();
// Get the first worksheet.
Worksheet sheet = workbook.Worksheets[0];
// Set the background image for the worksheet.
sheet.BackgroundImage = File.ReadAllBytes("background.jpg");
// Save the Excel file
workbook.Save("outputBackImageSheet.xlsx");
// Save the HTML file
workbook.Save("outputBackImageSheet.html", SaveFormat.Html);

相关文章