com.nostra13.universalimageloader.core.display
Class RoundedBitmapDisplayer

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

public class RoundedBitmapDisplayer
extends java.lang.Object
implements BitmapDisplayer

Displays bitmap with rounded corners. This implementation works only with ImageViews wrapped in ImageViewAware.
NOTE: It's strongly recommended your ImageView has defined width (layout_width) and height (layout_height) .
NOTE: New Bitmap object is created for displaying. So this class needs more memory and can cause OutOfMemoryError.

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

Constructor Summary
RoundedBitmapDisplayer(int roundPixels)
           
 
Method Summary
 android.graphics.Bitmap display(android.graphics.Bitmap bitmap, ImageAware imageAware, LoadedFrom loadedFrom)
          Display bitmap in ImageAware.
static android.graphics.Bitmap roundCorners(android.graphics.Bitmap bitmap, ImageViewAware imageAware, int roundPixels)
          Process incoming Bitmap to make rounded corners according to target ImageViewAware.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RoundedBitmapDisplayer

public RoundedBitmapDisplayer(int roundPixels)
Method Detail

display

public android.graphics.Bitmap display(android.graphics.Bitmap bitmap,
                                       ImageAware imageAware,
                                       LoadedFrom loadedFrom)
Description copied from interface: BitmapDisplayer
Display bitmap in ImageAware. Displayed bitmap should be returned.
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
Returns:
Bitmap which was displayed in ImageAware

roundCorners

public static android.graphics.Bitmap roundCorners(android.graphics.Bitmap bitmap,
                                                   ImageViewAware imageAware,
                                                   int roundPixels)
Process incoming Bitmap to make rounded corners according to target ImageViewAware.
This method doesn't display result bitmap in ImageView

Parameters:
bitmap - Incoming Bitmap to process
imageAware - Target ImageAware to display bitmap in
roundPixels - Rounded pixels of corner
Returns:
Result bitmap with rounded corners


Copyright © 2011-2013. All Rights Reserved.