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

ImgToStream

converte imagem para stream

Source

<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()

Author: Alex Martins

Submitted on: 23 aug. 2017

Language: VB

Type: image

Views: 3569