Back to Devexpress

SpreadsheetImageSource.FromUri(String, IServiceContainer) Method

officefileapi-devexpress-dot-spreadsheet-dot-spreadsheetimagesource-dot-fromuri-x28-system-dot-string-system-dot-componentmodel-dot-design-dot-iservicecontainer-x29.md

latest5.3 KB
Original Source

SpreadsheetImageSource.FromUri(String, IServiceContainer) Method

SECURITY-RELATED CONSIDERATIONS

Downloading images passed as URLs to the FromUri method may create security issues. Review the following help topic and learn how to spot, analyze, and prohibit unwanted download requests:

Suppress Control Requests to Download Data from External URLs

Creates an image source object from the specified URI string.

Namespace : DevExpress.Spreadsheet

Assembly : DevExpress.Spreadsheet.v25.2.Core.dll

NuGet Package : DevExpress.Spreadsheet.Core

Declaration

csharp
[ComVisible(false)]
public static SpreadsheetImageSource FromUri(
    string uri,
    IServiceContainer serviceContainer
)
vb
<ComVisible(False)>
Public Shared Function FromUri(
    uri As String,
    serviceContainer As IServiceContainer
) As SpreadsheetImageSource

Parameters

NameTypeDescription
uriString

A string of characters identifying the resource in the Internet that can be interpreted as an image.

| | serviceContainer | IServiceContainer |

An object providing the IUriStreamService interface which allows you to obtain a data stream for a specified URI.

|

Returns

TypeDescription
SpreadsheetImageSource

A SpreadsheetImageSource object representing the image in the spreadsheet.

|

Remarks

Use a Workbook instance as the service container to get images for the specified URI. You can also implement your own service provider, if required. See the IUriStreamProvider topic for more information.

The following code snippets (auto-collected from DevExpress Examples) contain references to the FromUri(String, IServiceContainer) method.

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.

winforms-spreadsheetcontrol-api-part-2/CS/SpreadsheetControl_API_Part02/SpreadsheetActions/PictureActions.cs#L62

csharp
// Create an image from Uri.
SpreadsheetImageSource imageSource = SpreadsheetImageSource.FromUri(imageUri, workbook);
// Set the measurement unit to point.

wpf-spreadsheetcontrol-api-part-2/CS/SpreadsheetControl_WPF_API_Part02/SpreadsheetActions/ShapeActions.cs#L56

csharp
// Create an image from Uri.
SpreadsheetImageSource imageSource = SpreadsheetImageSource.FromUri(imageUri, workbook);
// Set the measurement unit to point.

winforms-spreadsheetcontrol-api-part-2/VB/SpreadsheetControl_API_Part02/SpreadsheetActions/PictureActions.vb#L60

vb
' Create an image from Uri.
Dim imageSource As SpreadsheetImageSource = SpreadsheetImageSource.FromUri(imageUri, workbook)
' Set the measurement unit to point.

wpf-spreadsheetcontrol-api-part-2/VB/SpreadsheetControl_WPF_API_Part02/SpreadsheetActions/ShapeActions.vb#L54

vb
' Create an image from Uri.
Dim imageSource As SpreadsheetImageSource = SpreadsheetImageSource.FromUri(imageUri, workbook)
' Set the measurement unit to point.

See Also

SpreadsheetImageSource Class

SpreadsheetImageSource Members

DevExpress.Spreadsheet Namespace