Arka Plan Resmini Excel'e Ekle
Contents
[
Hide
]
Çalışma sayfası arka planı olarak bir resim ekleyerek çalışma sayfasını daha çekici hale getirebilirsiniz. Sayfadaki verileri gizlemeden arka plana dair bir ipucu ekleyen özel bir kurumsal grafiğiniz varsa, bu özellik oldukça etkili olabilir. Aspose.Cells API’i kullanarak bir sayfa için arka plan resmi ayarlayabilirsiniz.
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):
-
itibarenSayfa düzeni menü, bulSayfa ayarı seçeneğini ve ardındanArka fon seçenek.
-
Sayfanın arka plan resmini ayarlamak için bir resim seçin.
Sayfa arka planı ayarlama
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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"); |