ضبط الظلال لتأثيرات النص للشكل أو مربع النص
يمكنك ضبط الظلال لـ تأثيرات النص لأي شكل أو مربع نص. يرجى استخدام الخاصية Shape.TextBody. يقدم ضبط نص الشكل ويعيد FontSetting كائنات. بعد الوصول إليها، يرجى ضبط الظلال عبر الخاصية FontSetting.TextOptions.Shadow.PresetType.PresetType. هذه الخاصية من نوع PresetShadowType الذي يحتوي على عدة قيم. بعض هذه القيم هي
- إزاحة قطرية لأسفل اليمين
- إزاحة لأسفل
- إزاحة قطرية لأعلى اليمين
- داخل اليسار
- داخل الوسط
- زاوية رؤية قطرية العلوي الأيسر
- زاوية رؤية قطرية السفلي الأيمن
المقتطف التالي يوضح استخدام الخاصية FontSetting.TextOptions.Shadow.PresetType.PresetType لضبط ظلال تأثيرات النص للشكل أو مربع النص.
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-.NET | |
//Output directory | |
string outputDir = RunExamples.Get_OutputDirectory(); | |
// Create workbook object | |
Workbook wb = new Workbook(); | |
// Access first worksheet | |
Worksheet ws = wb.Worksheets[0]; | |
// Add text box with these dimensions | |
TextBox tb = ws.Shapes.AddTextBox(2, 0, 2, 0, 100, 400); | |
// Set the text of the textbox | |
tb.Text = "This text has the following settings.\n\nText Effects > Shadow > Offset Bottom"; | |
// Set all the text runs shadow to preset offset bottom | |
for (int i = 0; i < tb.TextBody.Count; i++) | |
{ | |
tb.TextBody[i].TextOptions.Shadow.PresetType = PresetShadowType.OffsetBottom; | |
} | |
// Set the font color and size of the textbox | |
tb.Font.Color = Color.Red; | |
tb.Font.Size = 16; | |
// Save the output file | |
wb.Save(outputDir + "outputSettingTextEffectsShadowOfShapeOrTextbox.xlsx", SaveFormat.Xlsx); |