Infoga bakgrundsbild i Excel

Ange bakgrund på kalkylblad i Microsoft Excel

För att ange ett kalkylblads bakgrundsbild i Microsoft Excel (t.ex. Microsoft Excel 2019):

  1. Från menyn Sidlayout, hitta alternativet Sidlayout och klicka sedan på alternativet Bakgrund.

  2. Välj en bild för att sätta kalkylbladets bakgrundsbild.

    Ange en ark-bakgrund

todo:image_alt_text

Ange bakgrundsbild med Aspose.Cells

Koden nedan ställer in en bakgrundsbild med en bild från en ström.

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

Relaterade artiklar