मेरे कोड कोड है:MediaStore.Images.Media.getBitmap और स्मृति त्रुटि से बाहर
public Bitmap loadPhoto(Uri uri) {
Bitmap scaled = null;
try {
scalled = Bitmap.createBitmap(
MediaStore.Images.Media.getBitmap(getContentResolver(), uri),
0,0,90, 90);
if (scaled == null) { return null; }
} catch(Exception e) { }
return scaled;
}
इस के बाद। मैं ImageView में स्केल किया गया। प्रत्येक छवि डिवाइस कैमरा से आता है।
हर बार, मुझे त्रुटि मिलती है: स्मृति से बाहर कैमरे से तीन फ़ोटो प्रदर्शित करने के बाद। इसे कैसे हल करें?
मैं एक ही समस्या थी, इस लिंक की जाँच: [http://tutorials-android.blogspot.co.il/2011/11/ आउटफमेमरी-अपवाद-कब-डीकोडिंग.html] (http://tutorials-android.blogspot.co.il/2011/11/outofmemory-exception-when-decoding.html) – zwebie
बिटमैप स्केलिंग पर चेत हास का अच्छा ट्यूटोरियल भी देखें: http://www.youtube.com/watch?v=12cB7gnL6po –
जागरूक रहें *** यह पृष्ठ DATE से बहुत दूर है *** - आज आप बस ऐसा करते हैं: http://stackoverflow.com/a/24135522/ 2 9 4884 – Fattie