com.nostra13.universalimageloader.core.display
Class RoundedBitmapDisplayer

java.lang.Object
  extended by com.nostra13.universalimageloader.core.display.RoundedBitmapDisplayer
All Implemented Interfaces:
BitmapDisplayer
Direct Known Subclasses:
RoundedVignetteBitmapDisplayer

public class RoundedBitmapDisplayer
extends Object
implements BitmapDisplayer

Can display bitmap with rounded corners. This implementation works only with ImageViews wrapped in ImageViewAware.
This implementation is inspired by Romain Guy's article. It rounds images using custom drawable drawing. Original bitmap isn't changed.

If this implementation doesn't meet your needs then consider RoundedImageView or CircularImageView projects for usage.

Since:
1.5.6
Author:
Sergey Tarasevich (nostra13[at]gmail[dot]com)

Nested Class Summary
static class RoundedBitmapDisplayer.RoundedDrawable
           
 
Field Summary
protected  int cornerRadius
           
protected  int margin
           
 
Constructor Summary
RoundedBitmapDisplayer(int cornerRadiusPixels)
           
RoundedBitmapDisplayer(int cornerRadiusPixels, int marginPixels)
           
 
Method Summary
 void display(android.graphics.Bitmap bitmap, ImageAware imageAware, LoadedFrom loadedFrom)
          Displays bitmap in ImageAware.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

cornerRadius

protected final int cornerRadius

margin

protected final int margin
Constructor Detail

RoundedBitmapDisplayer

public RoundedBitmapDisplayer(int cornerRadiusPixels)

RoundedBitmapDisplayer

public RoundedBitmapDisplayer(int cornerRadiusPixels,
                              int marginPixels)
Method Detail

display

public void display(android.graphics.Bitmap bitmap,
                    ImageAware imageAware,
                    LoadedFrom loadedFrom)
Description copied from interface: BitmapDisplayer
Displays bitmap in ImageAware. NOTE: This method is called on UI thread so it's strongly recommended not to do any heavy work in it.

Specified by:
display in interface BitmapDisplayer
Parameters:
bitmap - Source bitmap
imageAware - Image aware view to display Bitmap
loadedFrom - Source of loaded image


Copyright © 2011-2014. All Rights Reserved.