Inserisci un'immagine di sfondo in Excel

Impostazione dello sfondo del foglio in Microsoft Excel

Per impostare l’immagine di sfondo di un foglio in Microsoft Excel (ad esempio, Microsoft Excel 2019):

  1. DalLayout di pagina menu, trova ilImpostazione della pagina opzione, quindi fare clic suSfondo opzione.

  2. Seleziona un’immagine per impostare l’immagine di sfondo del foglio.

    Impostazione di uno sfondo del foglio

cose da fare:immagine_alt_testo

Impostazione dello sfondo del foglio con Aspose.Cells

Il codice seguente imposta un’immagine di sfondo utilizzando un’immagine da un flusso.

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

articoli Correlati