Excelに背景画像を挿入する
Contents
[
Hide
]
シートの背景に画像を追加することで、ワークシートをより魅力的にできます。この機能は、特定の企業用グラフィックを背景のヒントとして追加しつつ、シート上のデータを隠さない場合に非常に効果的です。Aspose.Cells for Python via .NET APIを使用して、シートの背景画像を設定できます。
Microsoft Excelでシート背景を設定する方法
-
ページレイアウトメニューからページの設定オプションを見つけ、背景オプションをクリックします。
-
ページレイアウトメニューからページ設定オプションを見つけ、背景オプションをクリックします。
-
シートの背景画像を設定するために画像を選択します。
シートの背景を設定する
Aspose.Cells for Python Excelライブラリを使用してシート背景を設定する方法
以下のコードは、ストリームから画像を使用して背景画像を設定します。
This file contains hidden or 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
from aspose.cells import SaveFormat, Workbook | |
# For complete examples and data files, please go to https:# github.com/aspose-cells/Aspose.Cells-for-.NET | |
# Create a new Workbook. | |
workbook = Workbook() | |
# Get the first worksheet. | |
sheet = workbook.worksheets[0] | |
# Set the background image for the worksheet. | |
sheet.background_image = open("background.jpg", "rb").read() | |
# Save the Excel file | |
workbook.save("outputBackImageSheet.xlsx") | |
# Save the HTML file | |
workbook.save("outputBackImageSheet.html", SaveFormat.HTML) |