imgToBase64
converte imagem em base64
Source
<Extension()> _
Public Function toBase64(ByVal img As Image) As String
Try
Dim ms As New System.IO.MemoryStream
Dim arrImage() As Byte
img.Save(ms, Imaging.ImageFormat.Bmp)
arrImage = ms.GetBuffer
Return Convert.ToBase64String(arrImage)
Catch ex As Exception
Return ""
End Try
End Function
Example
img.toBase64