Create circular image using picasso : <p>I want load the profilr picture image from web url and from the resourses make it circular using Picasso library. I am doing like,</p>

<pre><code>dependencies {
    compile 'com.squareup.picasso:picasso:2.4.0'
}
</code></pre>

<p>Load Image (<code>R.drawable.profile_sample</code>) from resources,</p>

<pre><code>Picasso.with(getApplicationContext()).load(R.drawable.profile_sample).placeholder(setCircularImage(R.drawable.profile_sample)).into(imageView_ProfilePic);
</code></pre>

<p>also from the url like,</p>

<pre><code>Picasso.with(getApplicationContext()).load("http://shidhints.com").placeholder(setCircularImage(R.drawable.profile_sample)).into(imageView_ProfilePic);
</code></pre>

<p>Also I am using setCircularImage() to make the image from resources to circular shape.</p>

<pre><code>private RoundedBitmapDrawable setCircularImage(int id) {
        Resources res = getApplicationContext().getResources();
        Bitmap src = BitmapFactory.decodeResource(res, id);
        RoundedBitmapDrawable roundedBitmapDrawable = RoundedBitmapDrawableFactory.create(res, src);
        roundedBitmapDrawable.setCornerRadius(Math.max(src.getWidth(), src.getHeight()) / 2.0f);
        return roundedBitmapDrawable;
    }
</code></pre>
