Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.
Aspose.Cells for .NET has exposed the TextOptions class along with the FontSettings.TextOptions property in order to control the appearance of the textual parts of a shape.
Here is a simple usage scenario of the FontSettings.TextOptions property.
C#
// Initialize Workbook instance
var book = new Workbook();
// Access first worksheet from collection
var sheet = book.Worksheets[0];
// Add a Shape of type TextBox to the collection
var shape = sheet.Shapes.AddTextBox(0, 0, 0, 0, 100, 200);
// Access TextOptions of Shape
var textOptions = shape.TextBody[1].TextOptions;
Aspose.Cells for .NET 8.9.2 has exposed the TextOptions.Fill, TextOptions.Outline, and TextOptions.Shadow properties, which allow you to control aspects of the textual contents of the shape, such as fill, shadow, and outline respectively.
Here is a simple usage scenario of the aforementioned properties.
C#
// Initialize Workbook instance
var book = new Workbook();
// Access first worksheet from collection
var sheet = book.Worksheets[0];
// Add a Shape of type TextBox to the collection
var shape = sheet.Shapes.AddTextBox(0, 0, 0, 0, 100, 200);
// Set text for TextBox
shape.Text = "Aspose";
// Access TextOptions of Shape
var textOptions = shape.TextBody[1].TextOptions;
// Set shadow
textOptions.Shadow.PresetType = PresetShadowType.Below;
// Set fill color
textOptions.Fill.FillType = FillType.Solid;
textOptions.Fill.SolidFill.Color = Color.Red;
// Set outline color
textOptions.Outline.SetOneColorGradient(Color.Blue, 0.3, GradientStyleType.Horizontal, 2);
Aspose.Cells for .NET has exposed the Shape.Line property, which returns an instance of LineFormat in order to control the appearance of the outline of a shape.
Here is a simple usage scenario of the Shape.Line property.
C#
// Initialize Workbook instance
var book = new Workbook();
// Access first worksheet from collection
var sheet = book.Worksheets[0];
// Add a Shape of type TextBox to the collection
var shape = sheet.Shapes.AddTextBox(0, 0, 0, 0, 100, 200);
// Access LineFormat of Shape
var line = shape.Line;
// Set weight of line
line.Weight = 1;
Aspose.Cells for .NET 8.9.2 has exposed the Shape.Fill property, which returns an instance of FillFormat in order to control the different aspects of a shape’s area.
The following is a simple usage scenario of the Shape.Fill property.
C#
// Initialize Workbook instance
var book = new Workbook();
// Access first worksheet from collection
var sheet = book.Worksheets[0];
// Add a Shape of type TextBox to the collection
var shape = sheet.Shapes.AddTextBox(0, 0, 0, 0, 100, 200);
// Access FillFormat of Shape
var fill = shape.Fill;
// Set color for fill
fill.SetOneColorGradient(Color.Red, 0.1, GradientStyleType.Horizontal, 2);
Please use the TextOptions class instead.
Please directly use the Shape.Fill and Shape.Line properties.
Please directly use the Shape.Fill and Shape.Line properties.
Please use the Shape.Line property instead.
Please use the Shape.Fill property instead.
Please use the FontSettings.TextOptions property instead.
Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.