Inserire un immagine di sfondo in Excel

Come impostare lo sfondo del foglio in Microsoft Excel

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

  1. Dal menu Layout di pagina, individuare l’opzione Imposta pagina e fare clic sull’opzione Sfondo.

  2. Seleziona un’immagine da impostare come sfondo del foglio.

    Impostazione di uno sfondo del foglio

todo:image_alt_text

Come impostare lo sfondo del foglio con Aspose.Cells per Python Excel Library

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

from aspose.cells import SaveFormat, Workbook
# For complete examples and data files, please go to https:# github.com/aspose-cells/Aspose.Cells-for-.NET
# Create a new Workbook.
workbook = Workbook()
# Get the first worksheet.
sheet = workbook.worksheets[0]
# Set the background image for the worksheet.
sheet.background_image = open("background.jpg", "rb").read()
# Save the Excel file
workbook.save("outputBackImageSheet.xlsx")
# Save the HTML file
workbook.save("outputBackImageSheet.html", SaveFormat.HTML)