Even after passing the inputstream to the decode function, it is giving OOM error. Is there any alternative solution to display large images ?
Kamal On Apr 14, 12:53 pm, Mario Zechner <[email protected]> wrote: > Try not to load the image into a byte array before passing it to the > BitmapFactory but rather pass the InputStream directly to the > BitmapFactory. There is a limit for the size of an image, however, 4mb > should work. > > On 14 Apr., 09:25, Kamal Hasan <[email protected]> wrote: > > > > > I want to display an image which is around 4 MB,It is giving > > Out of Memory while loading the image.It is working fine for small > > images. Is there any alternative method using which I can display > > large size images. > > > FileInputStream fin = new FileInputStream(new > > File("sdcard/DSC00712.jpg")); > > BufferedInputStream bis = new > > BufferedInputStream(fin); > > byte[] data = new byte[bis.available()]; > > bis.read(data, 0, data.length); > > Bitmap bitmap = > > BitmapFactory.decodeByteArray(data,0,data.length); > > if(bitmap!=null) > > img.setImageBitmap(bitmap); > > else > > Log.e("Bitmap "," Not Created"); > > > Please suggest me a method to display large images or its not possible > > to display large images !! -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en To unsubscribe, reply using "remove me" as the subject.

