Hello,
I'm trying to get the real size of an image displayed in an image view. Actually my image is larger than the screen and the imageview is resizing the image to diplay it. I'm looking for this new size.
I've tried to override the onDraw method of the ImageView in a custom view but I'm 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 clues ?