Android how to set transparency to custom part of ImageView
I would like to set a custom part of an image view to be transparent. However, the partial view inside does not have to be a rectangle. It could be parallelogram, triangle, etc... I know I can retrieve the corners of the shape that I want to set to transparent, I just don't know what to do with those inputs.
Any help is appreciated!
You will have to manually manipulate a bitmap that you set to the image view.
Bitmap someBitmap = BitmapFactory.decodeResource(getResources(), R.drawable.someimage); bmp.setPixel(x,y,Color.TRANSPARENT); someImageView.setBitmap(someBitmap);
Code not tested.
Try this imageView.setBackgroundColor(Color.TRANSPARENT);