I have a string that contains a maze.
I need to convert the string to image. So far, I tried base64encoder but it seems eclispse doesn't support it.
Is there any simple solution for it?
I already googled it.
public String arrayToString(String[][] stringarray)//converts arrays to string(maze array)
{
String str = "\n";
for (int i = 0; i < stringarray.length; i++)
{
for(int j = 0; j<stringarray[i].length;j++)
{
str+=stringarray[i][j];
}
str+="\n";
}
return str;
}
I need to convert str to image.
public Image Base64ToImage(String base64String)
{
// Convert Base64 String to byte[]
byte[] imageBytes = Convert.FromBase64String(base64String);
MemoryStream ms = new MemoryStream(imageBytes, 0,
imageBytes.length);
// Convert byte[] to Image
ms.Write(imageBytes, 0, imageBytes.length);
Image image = Image.FromStream(ms, true);
return image;
}
I tried this but eclipse didn't accept memorystream..