How to create white border around bitmap?

后端 未结 8 1757
萌比男神i
萌比男神i 2021-02-12 19:24

For example I want a white border of 10pixel around all 4 side of the bitmap. I am not using it for imageview I am currently using this code to crop image. May I know how I coul

8条回答
  •  南旧
    南旧 (楼主)
    2021-02-12 19:41

    You can create your targetRectangle 20px wider and 20px higher

    RectF targetRect = new RectF(left, top, left + scaledWidth + 20, top + scaledHeight + 20);
    

    and paint the background white

提交回复
热议问题