public static String roundCorner ( int radiusInner , int radiusOuter , int color ) { if ( radiusInner < 1 ) { throw new IllegalArgumentException ( "Radius must be greater than zero." ) ; } if ( radiusOuter < 0 ) { throw new IllegalArgumentException ( "Outer radius must be greater than or equal to zero." ) ; } StringBuilder builder = new StringBuilder ( FILTER_ROUND_CORNER ) . append ( "(" ) . append ( radiusInner ) ; if ( radiusOuter > 0 ) { builder . append ( "|" ) . append ( radiusOuter ) ; } final int r = ( color & 0xFF0000 ) >>> 16 ; final int g = ( color & 0xFF00 ) >>> 8 ; final int b = color & 0xFF ; return builder . append ( "," ) // . append ( r ) . append ( "," ) // . append ( g ) . append ( "," ) // . append ( b ) . append ( ")" ) // . toString ( ) ; }
This filter adds rounded corners to the image using the specified color as the background .