I have an ImageView
whose src
is being set to a transparent square png with rounded corners.
I am calling View.draw(canvas)
on the ImageView
to take a screenshot. It leaves a gray border around the rounded corners like the image in the link
What can I do to remove the gray border?
Here is what I have tried..
Bitmap viewBmp = Bitmap.createBitmap(wid, hgt, Bitmap.Config.ARGB_8888);
Canvas canvas = new Canvas(viewBmp);
if(isToMakeTransperant) canvas.drawColor(Color.TRANSPARENT);
myView.draw(canvas);
I have already tried setting PorterDuff.Mode.CLEAR
in drawColor()
method. It didn't work.
edit : yes, the isToMakeTransperant boolean
is always true. I have hard coded it to true
for testing.