-1

I'm trying to convert from ByteString to Image once i receive the ByteString from Socket Connection.

A string which I received from Socket Connection onMessage [size=302697hex=7c53657276657252657475726e4469723d54454d505f4449527c496d61676546696c654e616d653d496d6167655f3030312e6a70677c030905ffd8ffe000104a…]

How can I get the image from the above ByteString?

I tried to convert this string to Base64 URL, Byte Array but not worked for me.

Please help me to get out of this.

Thanks in Advance.

sjakobi
  • 3,546
  • 1
  • 25
  • 43
Ravi Makvana
  • 2,872
  • 2
  • 24
  • 38

1 Answers1

0

you need to first convert the hex string to byte array, then decode Base64 (not sure if required), then convert to image. If you can share a full sample string response, I check and verify the steps, and share the code.

you can use https://stackoverflow.com/a/18714790/11535103 to convert the hex string to byte array