officefileapi-devexpress-dot-spreadsheet-dot-shape-5c6e47a4.md
Gets or sets the descriptive (alternative) text for a drawing object.
Namespace : DevExpress.Spreadsheet
Assembly : DevExpress.Spreadsheet.v25.2.Core.dll
NuGet Package : DevExpress.Spreadsheet.Core
string AlternativeText { get; set; }
Property AlternativeText As String
| Type | Description |
|---|---|
| String |
A String value specifying the alternative text.
|
The AlternativeText property defines the alternative, text-based representation of a picture or chart content. This information can be useful for people with vision or cognitive impairments who may not be able to see or understand the object.
Set the Shape.Decorative property to true to mark that the drawing object does not contain meaningful content and is purely decorative.
The following code snippet specifies alternative text for an inserted picture:
using DevExpress.Spreadsheet;
//...
Workbook workbook = new Workbook();
workbook.BeginUpdate();
try {
Worksheet worksheet = workbook.Worksheets[0];
// Insert picture.
Picture picture = worksheet.Pictures.AddPicture("Pictures\\x-docserver.png", worksheet.Cells["A1"]);
picture.AlternativeText = "Excel file icons with error and data formats";
}
finally {
workbook.EndUpdate();
}
Imports DevExpress.Spreadsheet
'...
Private Sub SurroundingSub()
Dim workbook As Workbook = New Workbook()
workbook.BeginUpdate()
Try
Dim worksheet As Worksheet = workbook.Worksheets(0)
Dim picture As Picture = worksheet.Pictures.AddPicture("Pictures\x-docserver.png", worksheet.Cells("A1"))
picture.AlternativeText = "Excel file icons with error and data formats"
Finally
workbook.EndUpdate()
End Try
End Sub
The following code snippets (auto-collected from DevExpress Examples) contain references to the AlternativeText property.
Note
The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.
pic.Name = "Logo";
pic.AlternativeText = "Spreadsheet logo";
// Move a picture.
pic.Name = "Candles";
pic.AlternativeText = "Candles snapshot";
pic.BorderWidth = 1;
pic.Name = "Logo";
pic.AlternativeText = "Spreadsheet Logo";
pic.BorderWidth = 1;
office-file-api-ai-implementation/CS/Controllers/AccessibilityController.cs#L76
string description = await imageHelper.DescribeImageAsync(image);
chart.AlternativeText = description;
}
pic.Name = "Logo"
pic.AlternativeText = "Spreadsheet logo"
' Move a picture.
pic.Name = "Candles"
pic.AlternativeText = "Candles snapshot"
pic.BorderWidth = 1
pic.Name = "Logo"
pic.AlternativeText = "Spreadsheet Logo"
pic.BorderWidth = 1
See Also