java - Bitmap myBitmap = BitmapFactory.decodeByteArray(byteArray, 0, byteArray.length); gives dimension 0 -


am trying decode bitmap using bitmapfactory,but gives me height , width of output bitmap equal 0.could me out.my code follows.

 bitmap mybitmap = bitmapfactory.decodebytearray(bfile, 0, bfile.length);  system.out.println("heigth => "mybitmap.getheight() + "  width  => " + mybitmap.getwidth()); 

where bfile byte array generated .ico file.

thanks in advance!!!

try follows

bitmapfactory.options options = new bitmapfactory.options(); options.injustdecodebounds = true; bitmapfactory.decodefile("/sdcard/image.png", options); int width = options.outwidth; int height = options.outheight; 

Comments

Popular posts from this blog

user interface - How to replace the Python logo in a Tkinter-based Python GUI app? -

objective c - Greedy NSProgressIndicator Allocation -

how to set an OCR language in Google Drive -