@@ -597,7 +597,13 @@ public static Bitmap getCircularBitmap(final Bitmap bitmap) {
597597 return output ;
598598 }
599599
600- public static Bitmap getRoundedEdgeBitmap (final Bitmap bitmap , int radius ) {
600+ /**
601+ * Returns the passed bitmap with rounded corners
602+ * @param bitmap - the bitmap to modify
603+ * @param radius - the radius of the corners
604+ * @param borderColor - the border to apply (use Color.TRANSPARENT for none)
605+ */
606+ public static Bitmap getRoundedEdgeBitmap (final Bitmap bitmap , int radius , int borderColor ) {
601607 if (bitmap == null ) {
602608 return null ;
603609 }
@@ -616,10 +622,12 @@ public static Bitmap getRoundedEdgeBitmap(final Bitmap bitmap, int radius) {
616622 paint .setXfermode (new PorterDuffXfermode (PorterDuff .Mode .SRC_IN ));
617623 canvas .drawBitmap (bitmap , rect , rect , paint );
618624
619- paint .setStyle (Paint .Style .STROKE );
620- paint .setStrokeWidth (1f );
621- paint .setColor (Color .DKGRAY );
622- canvas .drawRoundRect (rectF , radius , radius , paint );
625+ if (borderColor != Color .TRANSPARENT ) {
626+ paint .setStyle (Paint .Style .STROKE );
627+ paint .setStrokeWidth (1f );
628+ paint .setColor (borderColor );
629+ canvas .drawRoundRect (rectF , radius , radius , paint );
630+ }
623631
624632 return output ;
625633 }
0 commit comments