6 messages in com.googlegroups.android-developersfinding visible size of a (image)view
FromSent OnAttachments
tkanstren30 Jan 2008 12:03 
hackbod30 Jan 2008 14:38 
tkanstren31 Jan 2008 11:23 
Anthony31 Jan 2008 21:55 
tkanstren01 Feb 2008 09:10 
Anthony01 Feb 2008 22:54 
Subject:finding visible size of a (image)view
From:tkanstren (tkan@gmail.com)
Date:01/30/2008 12:03:19 PM
List:com.googlegroups.android-developers

hello,

i need to find the size of the visible area of my imageview. i use a layout like this

<AbsoluteLayout xmlns:android="http://schemas.android.com/apk/res/ android" android:layout_width="1000px" android:layout_height="500px" android:padding="0px">

<ImageView id="@+id/my_image" android:layout_width="1000px" android:layout_height="500px" android:src="@drawable/icon" />

</AbsoluteLayout>

Now I want to find out how much of my image is displayed to calculate scrolling needs etc. I used DisplayMetrics.heightpixels and widthpixels. However, I think the given value for y axis includes the title bar and maybe even the android info bar on top. The given value is thus too high for me. I just want to know the size of the visible part of my image (or the imageview, which is the same thing), without the title etc. How do I do this?

Thanks,