How to get the height and width of an ImageView/Bitmap in Android
问题 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. 回答1: 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