png
png

Reputation: 4408

Android mask image

I have two images in my Drawable folder.

I want to mask image1 with image2 so that I get round edges for image1.

How can I achieve this? I saw some solutions with bufferedimage and getRGB.Is there any easier solution?

Upvotes: 2

Views: 3600

Answers (2)

Dany's
Dany's

Reputation: 928

You can try to directly create an rounded corners ImageView following the code from here How to make an ImageView with rounded corners?

Upvotes: 0

Paresh Mayani
Paresh Mayani

Reputation: 128428

  1. Take ImageView
  2. Set the border/frame 9-patch image as android:background
  3. Now set the actual image to the ImageView as android:src

Example of 9-patch frame:

enter image description here

Upvotes: 1

Related Questions