-3
웹 URL에서 프로필 사진 이미지를로드하고 해당 갤러리에서 피카소 라이브러리를 사용하여 원형으로 만듭니다. 나는 같은 자원에서피카소를 사용하여 원형 이미지 만들기
dependencies {
compile 'com.squareup.picasso:picasso:2.4.0'
}
이미지로드 (R.drawable.profile_sample
)를 수행하고있는 URL 등으로부터도
Picasso.with(getApplicationContext()).load(R.drawable.profile_sample).placeholder(setCircularImage(R.drawable.profile_sample)).into(imageView_ProfilePic);
,
또한
Picasso.with(getApplicationContext()).load("http://shidhints.com").placeholder(setCircularImage(R.drawable.profile_sample)).into(imageView_ProfilePic);
나는를 만들기 위해 setCircularImage()를 사용하고 있습니다 이미지를 원형에서 원형으로 변환합니다.
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;
}
https://stackoverflow.com/questions/30664254/using-picasso-library-with-a-circle-image-view –
https://stackoverflow.com/questions/26112150/android-create-circular-image -with-picasso –
안녕하세요 친구 원형 이미지 뷰 라이브러리 https://github.com/hdodenhof/CircleImageView를 사용하고 picasso를 사용하여로드하십시오. –