I want to convert an image to base64 and back to image again. Here is the code which i tried so far and the error also. Any suggestions please?
public void Ba
The MemoryStream.Read Method reads bytes from the MemoryStream into the specified byte array.
If you want to write the byte array to the MemoryStream, use the MemoryStream.Write Method:
ms.Write(imageBytes, 0, imageBytes.Length);
ms.Seek(0, SeekOrigin.Begin);
Alternatively, you can simply wrap the byte array in a MemoryStream:
MemoryStream ms = new MemoryStream(imageBytes);