Insertar imagen de fondo en Excel

Configuración del fondo de la hoja en Microsoft Excel

Para configurar la imagen de fondo de una hoja en Microsoft Excel (por ejemplo, Microsoft Excel 2019):

  1. Desde elDiseño de página menú, encuentra elConfiguración de página opción y, a continuación, haga clic en elAntecedentes opción.

  2. Seleccione una imagen para establecer la imagen de fondo de la hoja.

    Establecer un fondo de hoja

todo:imagen_alternativa_texto

Configuración de fondo de hoja con Aspose.Cells

El siguiente código establece una imagen de fondo utilizando una imagen de una secuencia.

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

Artículos relacionados