Excel e Arka Plan Görüntüsü Ekleme
Contents
[
Hide
]
Bir çalışma sayfasına resim ekleyerek çalışma sayfasını daha çekici hale getirebilirsiniz. Bu özellik, çalışma sayfasındaki verileri engellemeden arka plana hafif bir ipucu ekleyen özel bir kurumsal grafik veya resminiz varsa oldukça etkili olabilir. Aspose.Cells API’sini 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 görüntüsünü ayarlamak için (örneğin, Microsoft Excel 2019 için):
- Sayfa Düzeni menüsünden Sayfa Ayarı seçeneğini bulun ve ardından Arka Plan seçeneğine tıklayın.
- Tablonun arka plan resmini ayarlamak için bir resim seçin.
Aspose.Cells ile Sayfa Arka Planı Ayarlama
Aşağıdaki kod, bir akıştaki bir resim kullanarak arka plan resmini 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
import jpype | |
import asposecells | |
jpype.startJVM() | |
from asposecells.api import Workbook | |
# Create a new Workbook. | |
workbook = Workbook() | |
# Get the first worksheet. | |
worksheet = workbook.getWorksheets().get(0) | |
# Get the background picture. | |
with open('Background.jpg', 'rb') as f: | |
data = f.read() | |
# Set the background image for the sheet. | |
worksheet.setBackgroundImage(data) | |
# Save the excel file | |
workbook.save("output.xlsx") | |
jpype.shutdownJVM() |