إدراج صورة خلفية إلى إكسل
Contents
[
Hide
]
يمكنك جعل ورقة العمل أكثر جاذبية عن طريق إضافة صورة كخلفية للورقة. يمكن أن تكون هذه الميزة فعالة جدًا إذا كانت لديك رسوم بيانية خاصة بالشركة تضيف لمحة من الخلفية دون إخفاء البيانات على الورقة. يمكنك تعيين صورة الخلفية لورقة باستخدام API الخاصة بـ Aspose.Cells للبايثون via .NET.
كيفية تعيين خلفية ورقة في Microsoft Excel
لتعيين صورة خلفية لورقة في Microsoft Excel (على سبيل المثال، Microsoft Excel 2019):
-
من القائمة تخطيط الصفحة، ابحث عن خيار إعداد الصفحة، ثم انقر فوق خيار الخلفية.
-
حدد صورة لتعيين صورة خلفية للورقة.
تعيين خلفية لورقة
كيفية تعيين خلفية ورقة باستخدام مكتبة Aspose.Cells للبايثون إكسل
يقوم الكود أدناه بتعيين صورة خلفية باستخدام صورة من مصدر بيانات.
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) |