Wednesday 15 June 2011

decode - byte[] to png file in Android -


Hi I'm working on the application that receives .png files in the byte stream from the server. When I got it, I try to make it with bmp and later convert it to a .png file, but the following method ( bitmap emg = bitmapfiredererakabaytrere (result, 0, result length); < / Code>) returns me empty.

Here is my code:

  byte [] results bitmap img = bitmapfirederereakAbitArere (result, 0, result. Length); {File file name = new file (try imageUri.getPath (++); file parentFile = new file (imageUri.getPath ()); parentFile.mkdirs (); FileOutputStream Out = New FileOutputStream (file name); Img .compress (bitmap.compress format.png, 90, outside);} hold (FileNotFoundException e) {Log.e ("image downloaded", E. T. String ());} hold (exception e) {Log.e ( "Image download", estosting ());}  

but the img bitmap is always empty. I uploaded the image as multi-part data and it was a png file Was parsed byte array, but now when I do it I want to retrieve me get this ugly null. Thanks for any help.


No comments:

Post a Comment