당신은 유니버설 이미지 로더를 사용할 수 있습니다.
https://github.com/nostra13/Android-Universal-Image-Loader.
둥근 모서리가있는 비트 맵을 표시하는 데 사용할 수 있습니다. 위의 링크를 확인하십시오. 당신은 당신의 필요에 따라 다른 옵션을 구성 할 수 있습니다
ImageView image=(ImageView)vi.findViewById(R.id.imageview);
imageLoader.displayImage(imageurl, image,options);//provide imageurl, imageview and options
사용자 정의 어댑터 생성자 당신의 getView에서
File cacheDir = StorageUtils.getOwnCacheDirectory(a, "your folder");
// Get singletone instance of ImageLoader
imageLoader = ImageLoader.getInstance();
// Create configuration for ImageLoader (all options are optional)
ImageLoaderConfiguration config = new ImageLoaderConfiguration.Builder(a)
// You can pass your own memory cache implementation
.discCache(new UnlimitedDiscCache(cacheDir)) // You can pass your own disc cache implementation
.discCacheFileNameGenerator(new HashCodeFileNameGenerator())
.enableLogging()
.build();
// Initialize ImageLoader with created configuration. Do it once.
imageLoader.init(config);
options = new DisplayImageOptions.Builder()
.showStubImage(R.drawable.stub_id)//display stub image
.cacheInMemory()
.cacheOnDisc()
.displayer(new RoundedBitmapDisplayer(20)) //rounded corner bitmap
.build();
()에서
. http://www.curious-creature.org/2012/12/11/android-recipe-1-image-with-rounded-corners/
@ 모서리가 둥근
로맹 사람 이미지 How to make an ImageView with rounded corners?
http://ruibm.com/?p=184 @ 아래 발견.
public class ImageHelper {
public static Bitmap getRoundedCornerBitmap(Bitmap bitmap, int pixels) {
Bitmap output = Bitmap.createBitmap(bitmap.getWidth(), bitmap
.getHeight(), Config.ARGB_8888);
Canvas canvas = new Canvas(output);
final int color = 0xff424242;
final Paint paint = new Paint();
final Rect rect = new Rect(0, 0, bitmap.getWidth(), bitmap.getHeight());
final RectF rectF = new RectF(rect);
final float roundPx = pixels;
paint.setAntiAlias(true);
canvas.drawARGB(0, 0, 0, 0);
paint.setColor(color);
canvas.drawRoundRect(rectF, roundPx, roundPx, paint);
paint.setXfermode(new PorterDuffXfermode(Mode.SRC_IN));
canvas.drawBitmap(bitmap, rect, rect, paint);
return output;
}
}
getRoundedCornerBitmap() 메소드는 내가 –
안녕을 찾고 있었다, 어떻게 왼쪽 반올림하지 않도록 이미지의 우측 상단과 오른쪽 buttom의 작업을 수행하는 말해 줄 수 있습니까? –
@SampathKumar, 새로운 질문을해야합니다. 또한 이것이 도움이되는지 확인하십시오 : http://stackoverflow.com/questions/15962745/draw-a-semicircle-in-the-background-of-a-view 또는 http://developer.android.com/ reference/android/graphics/Canvas.html – dwbrito