Posted By

mracoker on 02/01/10


image VBNet base64

Versions (?)

Who likes this?

1 person have marked this snippet as a favorite


VB.NET Base64 To Image

 / Published in: VB.NET

  1. Function Base64ToImage(ByVal base64string As String) As System.Drawing.Image
  2. 'Setup image and get data stream together
  3. Dim img As System.Drawing.Image
  4. Dim MS As System.IO.MemoryStream = New System.IO.MemoryStream
  5. Dim b64 As String = base64string.Replace(" ", "+")
  6. Dim b() As Byte
  8. 'Converts the base64 encoded msg to image data
  9. b = Convert.FromBase64String(b64)
  10. MS = New System.IO.MemoryStream(b)
  12. 'creates image
  13. img = System.Drawing.Image.FromStream(MS)
  15. Return img
  16. End Function

Report this snippet  


RSS Icon Subscribe to comments
Posted By: JonyGreen on September 22, 2015

you can try this free online service to convert base64 to image online.

You need to login to post a comment.