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 FontSettings.TextOptions property in order to control the appearance of textual parts of a Shape.
Here is simple usage scenario of 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 & TextOptions.Shadow properties which allows to control the aspects of textual contents of the shape, such as fill, shadow & outline respectively.
Here is simple usage scenario of 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 outlines of a Shape.
Here is simple usage scenario of 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 shape area.
Following is the simple usage scenario of 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 TextOptions class instead.
Please directly use Shape.Fill and Shape.Line properties.
Please directly use Shape.Fill and Shape.Line properties.
Please use Shape.Line property instead.
Please use Shape.Fill property instead.
Please use FontSetting.TextOptions property instead.
Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.