Example usage for android.support.v4.graphics.drawable RoundedBitmapDrawable getPaint

List of usage examples for android.support.v4.graphics.drawable RoundedBitmapDrawable getPaint

Introduction

In this page you can find the example usage for android.support.v4.graphics.drawable RoundedBitmapDrawable getPaint.

Prototype

public final Paint getPaint() 

Source Link

Usage

From source file:com.gm.common.util.DrawableUtils.java

public static Drawable roundedBitmap(Context context, Bitmap bitmap) {
    RoundedBitmapDrawable circleDrawable = RoundedBitmapDrawableFactory.create(context.getResources(), bitmap);
    circleDrawable.getPaint().setAntiAlias(true);
    circleDrawable.setCircular(true);//from  w  ww .  j  a v  a 2 s.c om
    circleDrawable.setCornerRadius(Math.max(bitmap.getWidth(), bitmap.getHeight()) / 2.0f);
    return circleDrawable;
}