背景画像を Excel に挿入

Microsoft Excelでシートの背景を設定する

Microsoft Excel でシートの背景画像を設定するには (例: Microsoft Excel 2019):

  1. からページレイアウトメニューで、ページ設定オプションをクリックし、バックグラウンドオプション。

  2. 画像を選択して、シートの背景画像を設定します。

    シートの背景を設定する

todo:画像_代替_文章

Aspose.Cells でシートの背景を設定する

以下のコードは、ストリームからの画像を使用して背景画像を設定します。

// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-Java
// Create a new Workbook.
Workbook workbook = new Workbook();
// Get the first worksheet.
Worksheet sheet = workbook.getWorksheets().get(0);
// Get the image file.
File file = new File("background.jpg");
// Get the picture into the streams.
byte[] imageData = new byte[(int) file.length()];
FileInputStream fis = new FileInputStream(file);
fis.read(imageData);
// Set the background image for the sheet.
sheet.setBackgroundImage(imageData);
fis.close();
// Save the excel file
workbook.save("SBPforWorksheet.xlsx");

関連記事