ImgToStream

 <Extension()> _
    Public Function toStream(ByVal img As Image) As Byte()

        Dim ms As New System.IO.MemoryStream
        Dim arrImage() As Byte
        img.Save(ms, Imaging.ImageFormat.Bmp)
        arrImage = ms.GetBuffer
        Return arrImage

    End Function
Example:
img.toStream()

Description

converte imagem para stream

Details

Double click on the code to select all.

 

;