G
Guest
I have a function to do this in the full frame work
Public Function BitmapToBase64(ByVal image As System.Drawing.Bitmap) As String
Dim base64 As String
Dim memory As New System.IO.MemoryStream
image.Save(memory, Imaging.ImageFormat.Bmp)
base64 = System.Convert.ToBase64String(memory.ToArray)
memory.Close()
memory = Nothing
Return base64
End Function
However the image class and the bitmap cllass do not have Save as a member.
As such I'm a little stuck as to how to get the image into the memory stream
so it can then be converted to base64.
If anyone has a way of doing this I'd be most appreciative of a solution.
Public Function BitmapToBase64(ByVal image As System.Drawing.Bitmap) As String
Dim base64 As String
Dim memory As New System.IO.MemoryStream
image.Save(memory, Imaging.ImageFormat.Bmp)
base64 = System.Convert.ToBase64String(memory.ToArray)
memory.Close()
memory = Nothing
Return base64
End Function
However the image class and the bitmap cllass do not have Save as a member.
As such I'm a little stuck as to how to get the image into the memory stream
so it can then be converted to base64.
If anyone has a way of doing this I'd be most appreciative of a solution.