Impostazione dell'ombreggiatura degli effetti di testo di Shape o TextBox
Contents
[
Hide
]
Puoi impostare ilOmbra diEffetti di testo di qualsiasi Shape o TextBox. Si prega di utilizzare ilShape.TextBody proprietà. Presenta l’impostazione del testo della forma e ritornaImpostazione carattere oggetti. Dopo l’accesso, impostare il fileOmbra attraversoFontSetting.TextOptions.Shadow.PresetType.PresetType proprietà. Questa proprietà è del tipoPresetShadowTypeche ha diversi valori. Alcuni di questi lo sono
- OffsetDiagonalBottomRight
- OffsetBasso
- OffsetDiagonalTopRight
- DentroSinistra
- DentroCentro
- Prospettiva Diagonale Superiore Sinistra
- Prospettiva Diagonale Inferiore Destra
Il seguente frammento di codice illustra l’uso diFontSetting.TextOptions.Shadow.PresetType.PresetTypeproprietà per impostare l’ombreggiatura degli effetti di testo di Shape o TextBox.
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 | |
//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); |