Wednesday, July 9, 2014

How to convert Image to Byte Array in VB.NET?

You can convert Image to Byte Array like this.

    Public Function imageToByteArray(ByVal image As System.Drawing.Image) As Byte()
        Dim ms As New System.IO.MemoryStream()
        image.Save(ms, System.Drawing.Imaging.ImageFormat.Png)
        Return ms.ToArray
    End Function

No comments:

Post a Comment

React-select is very slow on larger list - Found solution - using react-window

 I had more than 4000 items in searchable dropdownlist. I have used react-select but it was very slow. finally I found complete solution to ...