ho bisogno di ottenere la larghezza e l'altezza di una bitmap, ma utilizzando questo dà un'eccezione di memoria:Android - la larghezza e l'altezza del bitmap senza caricarla
Resources res=getResources();
Bitmap mBitmap = BitmapFactory.decodeResource(res, R.drawable.pic);
BitmapDrawable bDrawable = new BitmapDrawable(res, mBitmap);
//get the size of the image and the screen
int bitmapWidth = bDrawable.getIntrinsicWidth();
int bitmapHeight = bDrawable.getIntrinsicHeight();
ho letto la soluzione alla domanda Get bitmap width and height without loading to memory ma quale sarebbe l'inputStream qui?
dal ur immagine è grande per caricare in memoria – KOTIOS
Ho pensato che troppo .. Di qui la domanda come ottenere le metriche senza caricare in memoria – Gooey