Arka Plan Resmini Excel'e Ekle

Microsoft Excel’de Sayfa Arka Planını Ayarlama

Microsoft Excel’de bir sayfanın arka plan resmini ayarlamak için (örneğin, Microsoft Excel 2019):

  1. itibarenSayfa düzeni menü, bulSayfa ayarı seçeneğini ve ardındanArka fon seçenek.

  2. Sayfanın arka plan resmini ayarlamak için bir resim seçin.

    Sayfa arka planı ayarlama

yapılacaklar:resim_alternatif_metin

Aspose.Cells ile Sayfa Arka Planını Ayarlama

Aşağıdaki kod, bir akıştan bir görüntü kullanarak bir arka plan görüntüsü ayarlar.

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

İlgili Makaleler