public Bitmap DecodeFile(String Url)
        {
                try {
                        URL aURL = new URL(Url);
                        URLConnection conn = aURL.openConnection();
                        conn.connect();
                        InputStream is = conn.getInputStream();
                        BufferedInputStream bis = new
BufferedInputStream(is);
                        Bitmap bm = BitmapFactory.decodeStream(bis);
                        bis.close();
                        is.close();
                        return bm;
                }
                catch (Exception e)
                {
                        return null;
                }
        }

I am using the above code to decode the bitmap , and save it inito the
imageview
but i get out-of-memory error when loading a lots of image
i did try to use "BitmapFactory.Options options = new
BitmapFactory.Options();
                        options.inSampleSize = 5;"
but the image lose its quality and resized.
is there any better way to do that such that the image will not be
resized and lose quality?

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to