RoundedBitmapDrawable

A Drawable that wraps a bitmap and can be drawn with rounded corners. You can create a RoundedBitmapDrawable from a file path, an input stream, or from a android.graphics.Bitmap object.

Also see the android.graphics.Bitmap class, which handles the management and transformation of raw bitmap graphics, and should be used when drawing to a android.graphics.Canvas.

Functions

Link copied to clipboard
open fun draw(@NonNull canvas: @NonNull Canvas)
Link copied to clipboard
open fun getAlpha(): Int
Link copied to clipboard
@Nullable
fun getBitmap(): @Nullable Bitmap
Returns the bitmap used by this drawable to render.
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open fun getGravity(): Int
Get the gravity used to position/stretch the bitmap within its bounds.
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open fun getOpacity(): Int
Link copied to clipboard
@NonNull
fun getPaint(): @NonNull Paint
Returns the paint used to render this drawable.
Link copied to clipboard
open fun hasAntiAlias(): Boolean
Indicates whether anti-aliasing is enabled for this drawable.
Link copied to clipboard
open fun hasMipMap(): Boolean
Indicates whether the mipmap hint is enabled on this drawable's bitmap.
Link copied to clipboard
open fun isCircular(): Boolean
Link copied to clipboard
open fun setAlpha(alpha: Int)
Link copied to clipboard
open fun setAntiAlias(aa: Boolean)
Enables or disables anti-aliasing for this drawable.
Link copied to clipboard
open fun setCircular(circular: Boolean)
Sets the image shape to circular.
Link copied to clipboard
Link copied to clipboard
open fun setCornerRadius(cornerRadius: Float)
Sets the corner radius to be applied when drawing the bitmap.
Link copied to clipboard
open fun setDither(dither: Boolean)
Link copied to clipboard
open fun setFilterBitmap(filter: Boolean)
Link copied to clipboard
open fun setGravity(gravity: Int)
Set the gravity used to position/stretch the bitmap within its bounds.
Link copied to clipboard
open fun setMipMap(mipMap: Boolean)
Enables or disables the mipmap hint for this drawable's bitmap.
Link copied to clipboard
open fun setTargetDensity(@NonNull canvas: @NonNull Canvas)
open fun setTargetDensity(@NonNull metrics: @NonNull DisplayMetrics)
Set the density scale at which this drawable will be rendered.
open fun setTargetDensity(density: Int)
Set the density at which this drawable will be rendered.