Insérer une image d arrière plan dans Excel

Configuration de l’arrière-plan de la feuille dans Microsoft Excel

Pour définir une image d’arrière-plan de la feuille dans Microsoft Excel (par exemple, Microsoft Excel 2019) :

  1. Dans le menu Mise en page, recherchez l’option Configuration de la page, puis cliquez sur l’option Arrière-plan.

  2. Sélectionnez une image pour définir l’arrière-plan de la feuille.

    Configuration d’un arrière-plan de feuille

todo:image_alt_text

Configuration de l’arrière-plan de la feuille avec Aspose.Cells

Le code ci-dessous définit une image d’arrière-plan à l’aide d’une image provenant d’un flux.

// 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");

Articles Connexes