| | |
| | | //
|
| | | // return output;
|
| | |
|
| | | mBitmap = getRoundedBitmap(mBitmap, cornerRadius);
|
| | | BitmapUtil bitmapUtil = new BitmapUtil();
|
| | |
|
| | | mBitmap = mBitmap.copy(mBitmap.getConfig(), true);
|
| | |
|
| | | mBitmap = bitmapUtil.getRoundedBitmap(mBitmap, cornerRadius);
|
| | |
|
| | | // Add a border around rounded corners bitmap
|
| | | mBitmap = addBorderToRoundedBitmap(mBitmap, cornerRadius, 10, Color.WHITE);
|
| | | mBitmap = bitmapUtil.addBorderToRoundedBitmap(mBitmap, cornerRadius, 10, Color.WHITE);
|
| | |
|
| | | // Add a border around rounded corners bitmap as shadow
|
| | | mBitmap = addBorderToRoundedBitmap(mBitmap, cornerRadius, 3, Color.LTGRAY);
|
| | | mBitmap = bitmapUtil.addBorderToRoundedBitmap(mBitmap, cornerRadius, 3, Color.LTGRAY);
|
| | | return mBitmap;
|
| | | }
|
| | |
|
| | |
| | | }
|
| | |
|
| | | // Custom method to create rounded bitmap from a rectangular bitmap
|
| | | public static Bitmap getRoundedBitmap(Bitmap srcBitmap, int cornerRadius) {
|
| | | public Bitmap getRoundedBitmap(Bitmap srcBitmap, int cornerRadius) {
|
| | | // Initialize a new instance of Bitmap
|
| | | Bitmap dstBitmap = Bitmap.createBitmap(
|
| | | srcBitmap.getWidth(), // Width
|
| | |
| | | }
|
| | |
|
| | | // Custom method to add a border around rounded bitmap
|
| | | public static Bitmap addBorderToRoundedBitmap(Bitmap srcBitmap, int cornerRadius, int borderWidth, int borderColor){
|
| | | public Bitmap addBorderToRoundedBitmap(Bitmap srcBitmap, int cornerRadius, int borderWidth, int borderColor){
|
| | | // We will hide half border by bitmap
|
| | | borderWidth = borderWidth*2;
|
| | |
|