Original image size VS displayed image size
<p>I am trying to get the size of the image displayed on my screen, not the original size of the image. </p>

<p>I already did some research on it and I found the same question on the unresolved <a href="http://stackoverflow.com/questions/3855218/trying-to-get-the-display-size-of-an-image-in-an-imageview">post</a> two years old, so I was thinking maybe now there is a new way to do it.</p>

<p>I tried this 3 solutions : </p>

<pre><code>//Get the same result for all my images (whereas images have difference sizes)
imageView.getWidth() + imageView.getHeight()

//Get the original size of the images  
imageView.getDrawable().getIntrinsicWidth() + imageView.getDrawable().getIntrinsicHeight()
bitMap.getWidth() + bitMap.getHeight()
</code></pre>

<p>My xml :</p>

<pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="1dip" &gt;

&lt;ImageView
android:id="@+id/image"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_gravity="center"
android:adjustViewBounds="true"
android:contentDescription="@string/descr_image"
android:layout_alignParentBottom="true" /&gt;

&lt;ProgressBar
android:id="@+id/loading"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:visibility="gone" /&gt;

&lt;WebView  xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/webView1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
/&gt;
&lt;/RelativeLayout&gt;
</code></pre>

<p><strong>Update 1</strong></p>

<pre><code>ViewTreeObserver viewTreeObserver = imageView.getViewTreeObserver();
if (viewTreeObserver.isAlive()) {
     viewTreeObserver.addOnGlobalLayoutListener(new OnGlobalLayoutListener() {
       @SuppressWarnings("deprecation")
       public void onGlobalLayout() {      
           imageView.getViewTreeObserver().removeGlobalOnLayoutListener(this)               
           System.out.println("TEST :" + imageView.getWidth() + " " + imageView.getHeight());
        }
    });
}
</code></pre>
