I am trying to get the actual size of the image displayed in the image view. In fact, my image is larger than the screen, and the image is viewing the image to change it. I am looking for a new size.
I tried to override the onDraw ImageView method in the user view, but I am not getting the correct height and width ...
public class LandImageView extends ImageView { public LandImageView( Context context ) { super( context ); } public LandImageView(Context context, AttributeSet attrs) { super(context, attrs); } public LandImageView(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); } @Override protected void onDraw( Canvas canvas ) { super.onDraw( canvas ); int test = this.getWidth(); int test2 = this.getHeight(); } @Override protected void onSizeChanged(int w, int h, int oldw, int oldh) { super.onSizeChanged(w, h, oldw, oldh); } }
Do you have any hints?
android imageview ondraw
Guillaume Mรฉnant 04 Oct '10 at 12:31
source share