0

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.

Phantômaxx
  • 37,901
  • 21
  • 84
  • 115
Chandan Pednekar
  • 525
  • 5
  • 19

1 Answers1

0

you can create transition bitmap

Bipmap bimap = Bitmap.createBitmap(BitmaoFactory.decodeResource(context.getResources(), R.color.transtion), 0, 0, width, height);
igarasi
  • 137
  • 7