Back to Devexpress

SpreadsheetImageSource.FromStream(Stream) Method

officefileapi-devexpress-dot-spreadsheet-dot-spreadsheetimagesource-dot-fromstream-x28-system-dot-io-dot-stream-x29.md

latest4.4 KB
Original Source

SpreadsheetImageSource.FromStream(Stream) Method

Creates an image source object from the specified data stream.

Namespace : DevExpress.Spreadsheet

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

NuGet Package : DevExpress.Spreadsheet.Core

Declaration

csharp
[ComVisible(false)]
public static SpreadsheetImageSource FromStream(
    Stream stream
)
vb
<ComVisible(False)>
Public Shared Function FromStream(
    stream As Stream
) As SpreadsheetImageSource

Parameters

NameTypeDescription
streamStream

A Stream containing image data.

|

Returns

TypeDescription
SpreadsheetImageSource

A SpreadsheetImageSource object representing the image in the spreadsheet.

|

The following code snippets (auto-collected from DevExpress Examples) contain references to the FromStream(Stream) 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#L28

csharp
Stream imageStream = Assembly.GetExecutingAssembly().GetManifestResourceStream("SpreadsheetControl_API.Pictures.x-spreadsheet.png");
SpreadsheetImageSource imageSource = SpreadsheetImageSource.FromStream(imageStream);
workbook.BeginUpdate();

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

csharp
Stream imageStream = Assembly.GetExecutingAssembly().GetManifestResourceStream("SpreadsheetControl_WPF_API_Part02.Pictures.chart.png");
SpreadsheetImageSource imageSource = SpreadsheetImageSource.FromStream(imageStream);
workbook.BeginUpdate();

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

vb
Dim imageStream As Stream = System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceStream("x-spreadsheet.png")
Dim imageSource As SpreadsheetImageSource = SpreadsheetImageSource.FromStream(imageStream)
workbook.BeginUpdate()

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

vb
Dim imageStream As Stream = System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceStream("chart.png")
Dim imageSource As SpreadsheetImageSource = SpreadsheetImageSource.FromStream(imageStream)
workbook.BeginUpdate()

See Also

SpreadsheetImageSource Class

SpreadsheetImageSource Members

DevExpress.Spreadsheet Namespace