2012-07-27 15 views

cevap

28

Daha ayrıntılı bilgi için bellekte

BitmapFactory.Options bitmapOptions = new BitmapFactory.Options(); 
bitmapOptions.inJustDecodeBounds = true; 
BitmapFactory.decodeStream(inputStream, null, bitmapOptions); 
int imageWidth = bitmapOptions.outWidth; 
int imageHeight = bitmapOptions.outHeight; 
inputStream.close(); 

bitmap piksel yüklemeden görüntü genişlik ve yükseklik almak için inJustDecodeBounds ile BitmapFactory.Options ayarlayabilirsiniz:

kamu boolean inJustDecodeBounds

Bu yana: API Seviye 1 true olarak ayarlanmışsa, dekoderi null (bitmap yok) döndürür, ancak out ... alanları hala ayarlamak için, arayanın pikselleri için bellek ayırmak üzere olmadan bitmap'i sorgulamasını sağlar.

http://developer.android.com/reference/android/graphics/BitmapFactory.Options.html#inJustDecodeBounds

+1

nihayet bit eşlem yüklemek gerektiğinde sistem ekran yoğunluğunu ilgili bitmap Ölçek çünkü değil, gayet iyi çalışıyor mu. Bu, her zaman yalnızca BitmapFactory.Options.inScaled = false ise doğrudur – Tobliug

İlgili konular