3

i wanna do the mask animation to the ImageView the below image shows my requirement enter image description here

Basheer
  • 404
  • 2
  • 9
  • 17
  • check [this](http://stackoverflow.com/questions/12614542/maskingcrop-image-in-frame/12637039#12637039) – maddy d Apr 16 '14 at 10:52
  • @maddy thanks for your response i already tried this here i am going to capture the image via camera and i converted the image as normal and gray scale image after that i placed the gray scale image over the normal image and i wanna do the above animation to hide the gray scale image and show hte original image – Basheer Apr 16 '14 at 11:07
  • ok. I didn't no about that, that much I can do because I don't no much about `ImageMasking` and I am curious about how it can be done. I have vote-Up for this. – maddy d Apr 16 '14 at 11:23

1 Answers1

1

Yes you can. I made a framelayout that supports masking. The mask is a drawable but it can also be an animationDrawable. Shameless selfplug

<com.christophesmet.android.views.maskableframelayout.MaskableFrameLayout
android:id="@+id/frm_mask_animated"
android:layout_width="100dp"
app:porterduffxfermode="DST_IN"
app:mask="@drawable/animation_mask"
android:layout_height="100dp">

<ImageView android:layout_width="match_parent"
           android:layout_height="match_parent"
           android:scaleType="centerCrop"
           android:src="@drawable/unicorn"/>

You can find it here

Christophe Smet
  • 850
  • 10
  • 11