corelibraries-devexpress-dot-drawing-dot-dximage-dot-fromstream-x28-system-dot-io-dot-stream-x29.md
Creates an image from the specified stream that contains the image data.
Namespace : DevExpress.Drawing
Assembly : DevExpress.Drawing.v25.2.dll
NuGet Package : DevExpress.Drawing
public static DXImage FromStream(
Stream stream
)
Public Shared Function FromStream(
stream As Stream
) As DXImage
| Name | Type | Description |
|---|---|---|
| stream | Stream |
A stream that contains data for the image.
|
| Type | Description |
|---|---|
| DXImage |
The created image.
|
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-chart-add-a-custom-legend-item/CS/CustomLegendItemSample/Form1.cs#L20
FileStream outfile = new FileStream("Image\\DXLogo_16x16.png", FileMode.Open);
DXImage image = DXImage.FromStream(outfile);
item.MarkerImage.DXImage = image;
if (!photoCache.ContainsKey(employee.FullName))
photoCache.Add(employee.FullName, DXImage.FromStream(stream));
}
winforms-chart-draw-a-custom-legend-marker-for-a-series/CS/CustomDrawingSample/Form1.cs#L66
if (!photoCache.ContainsKey(employee.FullName))
photoCache.Add(employee.FullName, DXImage.FromStream(stream));
}
if (!photoCache.ContainsKey(employee.FullName))
photoCache.Add(employee.FullName, DXImage.FromStream(stream));
}
spreadsheet-document-api-execute-mail-merge-in-code/CS/EmployeeInfo/EmployeeInfo.cs#L58
if (value != null)
Photo = DXImage.FromStream(new MemoryStream(value));
else
' Now, create an image annotation, and add it to the chart's collection.
chartControl1.Annotations.AddImageAnnotation("Annotation 2", DXImage.FromStream(New FileStream("...\...\image.png", FileMode.Open, FileAccess.Read, FileShare.Read)))
' Define the X and Y absolute coordinates for the annotation, in pixels.
winforms-chart-add-a-custom-legend-item/VB/CustomLegendItemSample/Form1.vb#L24
Dim outfile As FileStream = New FileStream("Image\DXLogo_16x16.png", FileMode.Open)
Dim image As DXImage = DXImage.FromStream(outfile)
item.MarkerImage.DXImage = image
Using stream As System.IO.MemoryStream = New System.IO.MemoryStream(employee.Photo)
If Not Me.photoCache.ContainsKey(employee.FullName) Then Me.photoCache.Add(employee.FullName, DevExpress.Drawing.DXImage.FromStream(stream))
End Using
winforms-chart-draw-a-custom-legend-marker-for-a-series/VB/CustomDrawingSample/Form1.vb#L69
Using stream As MemoryStream = New MemoryStream(employee.Photo)
If Not photoCache.ContainsKey(employee.FullName) Then photoCache.Add(employee.FullName, DXImage.FromStream(stream))
End Using
Using stream As MemoryStream = New MemoryStream(employee.Photo)
If Not photoCache.ContainsKey(employee.FullName) Then photoCache.Add(employee.FullName, DXImage.FromStream(stream))
End Using
See Also