Dim stream As System.IO.MemoryStream = New MemoryStream() stream.Position = 0 Dim image As Byte() = New Byte(stream.Length) {} stream.Read(image, 0, image.Length)