HI,
I want to get width and height of the image which i was stored in the drawable folder. Is this possible, if so please let me know ?
The Image Height is one part of the information that determines a picture's, photo's or other image's dimension. Together with the image width, this value determines the size of an image itself, not the file size. Often, Image Height is given in pixels, e.g. 682 px.
If you right-click an image file in Windows Explorer and select Properties, you obtain the image information with the pixel size. You can see how many pixels the image is made up of, and the image resolution.
try
BitmapDrawable bd=(BitmapDrawable) this.getResources().getDrawable(R.drawable.icon); int height=bd.getBitmap().getHeight(); int width=bd.getBitmap().getWidth();
I have follow this link :-
Drawable d = getResources().getDrawable(R.drawable.yourimage); int h = d.getIntrinsicHeight(); int w = d.getIntrinsicWidth();
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With