Issue
I have a map view with markers on it. I need do display a popup right above these markers, however, the MapView.LayoutParams only accepts pixels as the x-axis offset. Since the image will be different sizes on different screens, I'm wondering how I can get the height of the Drawable in pixels.
Thanks
Solution
Do you mean that you need to find the height and width of a particular drawable ? If that is the case then you can use something like this
BitmapDrawable image_dimen=(BitmapDrawable) this.getResources().getDrawable(R.drawable.imageb);
int height=image_dimen.getBitmap().getHeight();
int width=image_dimen.getBitmap().getWidth();
Answered By - Android2390
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.