I want to get the height and width of an image bitmap that is either in ImageView or a background image. Please help me, any help will be appreciated.
I want to get the height and width of an image bitmap that is
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can get height and width of ImageView by using getWidth() and getHeight() through while this will not give you the exact width and height of the image, for getting the Image width height first you need to get the drawable as background then convert drawable to BitmapDrawable to get the image as Bitmap from that you can get the width and height like here
or do like here
the above code will give you current imageview sized bitmap like screen shot of device
for only ImageView size
If you have drawable image and you want that size you can get like this way