Hi Naveen,
See this code and pass the parameters bitmap and round i.e., by how
much rounded u want...
private static Bitmap getRoundedCornerImage(Bitmap src, float round) {
// TODO Auto-generated method stub
int width = src.getWidth();
int height = src.getHeight();
// create bitmap output
Bitmap result = Bitmap.createBitmap(width, height,
Config.ARGB_8888);
// set canvas for painting
Canvas canvas = new Canvas(result);
canvas.drawARGB(0, 0, 0, 0);
// config paint
final Paint paint = new Paint();
paint.setAntiAlias(true);
paint.setColor(Color.BLACK);
// config rectangle for embedding
final Rect rect = new Rect(0, 0, width, height);
final RectF rectF = new RectF(rect);
// draw rect to canvas
canvas.drawRoundRect(rectF, round, round, paint);
// create Xfer mode
paint.setXfermode(new PorterDuffXfermode(Mode.SRC_IN));
// draw source image to canvas
canvas.drawBitmap(src, rect, rect, paint);
// return final image
return result;
}
On Feb 16, 1:58 pm, chowdary nani <[email protected]> wrote:
> Hi all,
> I am working on displaying the image in rounded corner image view
> when i used to drag the image the image is coming out of the borders and
> displaying in rectangle
> please help me
>
> Thanks
> Naveen.
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en