[EMAIL PROTECTED] wrote:
> Hi,
> 
> Just tried using the ImageButton for the first time but I could really
> do with some help on the masking of the image it uses. I currently
> assign the image to the button in the XML file like so:
> 
> <ImageButton android:id="@+id/button_zoom_in"
>               android:layout_width="wrap_content"
>               android:layout_height="wrap_content"
>               android:src="@drawable/zoom_in"/>
> 
> The zoom_in image constists of a cross with a white background, when
> the user clicks on the button I'd like the white background to be
> invisible so only the cross is shown (with the white background
> covered by the amber/orange highlight colour of the button). What is
> the easiest way to do this? is there a way to alpha out the white or
> maybe mask it out?

You could create a second image that looks how you want, and call 
setImageResource() on your ImageView when it comes time to change the image.

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com

Android Training on the Ranch! -- Mar 16-20, 2009
http://www.bignerdranch.com/schedule.shtml

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to