ExtensionMethod.NET Home of 875 C#, Visual Basic, F# and Javascript extension methods

streamToImage

Converte Array stream em imagem

Source

<Extension()> _
Public Function toImage(bytes As Byte()) As Image
    Try
        Return Image.FromStream(New IO.MemoryStream(bytes))
    Catch ex As Exception
        Return Nothing
    End Try
End Function

Example

pic.image = MyByte.ToImage

Author: Alex Martins

Submitted on: 23 aug 2017

Language: VB

Type: Byte

Views: 3463