إضافة ارتباطات تشعبية للصورة
Contents
[
Hide
]
تعتبر الارتباطات التشعبية مفيدة للوصول إلى المعلومات الموجودة في أوراق العمل الأخرى أو على مواقع الويب. Microsoft يتيح Excel للمستخدمين إضافة وصلات مرجعية على النص في الخلايا وعلى الصور. يمكن أن تجعل الارتباطات التشعبية للصور التنقل في ورقة العمل أسهل ، على سبيل المثال ، مثل الأزرار التالية والسابقة ، أو الشعارات التي ترتبط بمواقع معينة. يشرح هذا المستند كيفية إدراج الارتباطات التشعبية للصور في ورقة عمل باستخدام Aspose.Cells.
Aspose.Cells يسمح لك باضافة الوصلات المرجعية للصور في جداول البيانات في وقت التشغيل. من الممكن ضبط وتعديل تلميح الشاشة والعنوان الخاصين بالرابط. يوضح نموذج التعليمات البرمجية التالي كيفية إضافة ارتباط تشعبي لصورة في ورقة عمل.
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-.NET | |
// The path to the documents directory. | |
string dataDir = RunExamples.GetDataDir(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); | |
// Create directory if it is not already present. | |
bool IsExists = System.IO.Directory.Exists(dataDir); | |
if (!IsExists) | |
System.IO.Directory.CreateDirectory(dataDir); | |
// Instantiate a new workbook | |
Workbook workbook = new Workbook(); | |
// Get the first worksheet | |
Worksheet worksheet = workbook.Worksheets[0]; | |
// Insert a string value to a cell | |
worksheet.Cells["C2"].PutValue("Image Hyperlink"); | |
// Set the 4th row height | |
worksheet.Cells.SetRowHeight(3, 100); | |
// Set the C column width | |
worksheet.Cells.SetColumnWidth(2, 21); | |
// Add a picture to the C4 cell | |
int index = worksheet.Pictures.Add(3, 2, 4, 3, dataDir+ "aspose-logo.jpg"); | |
// Get the picture object | |
Aspose.Cells.Drawing.Picture pic = worksheet.Pictures[index]; | |
// Set the placement type | |
pic.Placement = PlacementType.FreeFloating; | |
// Add an image hyperlink | |
Aspose.Cells.Hyperlink hlink = pic.AddHyperlink("http://www.aspose.com/"); | |
// Specify the screen tip | |
hlink.ScreenTip = "Click to go to Aspose site"; | |
dataDir = dataDir + "ImageHyperlink.out.xls"; | |
// Save the Excel file | |
workbook.Save(dataDir); |