C# How to get image from array of bytes (blob converted into array of bytes)?

  • Thread starter Thread starter Ajay0311
  • Start date Start date
A

Ajay0311

Guest
We are saving a picture from android app to MySQL blob. Now we want to get that image in C#. Can anyone suggest a equivalent code for C#? We want to show original image. I have successfully retrieved data from database. it is returning me array of bytes.I have tried lots of methods but I am getting image with small size and with low quality


public String getStringImage(Bitmap bmp){
ByteArrayOutputStream baos=new ByteArrayOutputStream();
bmp.compress(Bitmap.CompressFormat.JPEG, 100, baos);
byte[] imageBytes= baos.toByteArray();
String encodedImage= Base64.encodeToString(imageBytes, Base64.DEFAULT)
return encodedImage;


}

Continue reading...
 
Back
Top