# RoundedBitmapDrawableFactory

Artifact: [androidx.core:core](https://developer.android.com/jetpack/androidx/releases/core) [View Source](https://cs.android.com/search?q=file:androidx/core/graphics/drawable/RoundedBitmapDrawableFactory.java+class:androidx.core.graphics.drawable.RoundedBitmapDrawableFactory) Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)

*** ** * ** ***


```
public final class RoundedBitmapDrawableFactory
```

<br />

*** ** * ** ***

Constructs `https://developer.android.com/reference/androidx/core/graphics/drawable/RoundedBitmapDrawable` objects, either from Bitmaps directly, or from streams and files.

## Summary

| ### Public methods |
|---|---|
| `static @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/core/graphics/drawable/RoundedBitmapDrawable` | `https://developer.android.com/reference/androidx/core/graphics/drawable/RoundedBitmapDrawableFactory#create(android.content.res.Resources,android.graphics.Bitmap)(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/content/res/Resources.html res, @https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/android/graphics/Bitmap.html bitmap)` Returns a new drawable by creating it from a bitmap, setting initial target density based on the display metrics of the resources. |
| `static @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/core/graphics/drawable/RoundedBitmapDrawable` | `https://developer.android.com/reference/androidx/core/graphics/drawable/RoundedBitmapDrawableFactory#create(android.content.res.Resources,java.lang.String)(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/content/res/Resources.html res, @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/String.html filepath)` Returns a new drawable, creating it by opening a given file path and decoding the bitmap. |
| `static @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/core/graphics/drawable/RoundedBitmapDrawable` | `https://developer.android.com/reference/androidx/core/graphics/drawable/RoundedBitmapDrawableFactory#create(android.content.res.Resources,java.io.InputStream)(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/content/res/Resources.html res, @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/io/InputStream.html is)` Returns a new drawable, creating it by decoding a bitmap from the given input stream. |

## Public methods

### create

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)

```
public static @NonNull RoundedBitmapDrawable create(@NonNull Resources res, @Nullable Bitmap bitmap)
```

Returns a new drawable by creating it from a bitmap, setting initial target density based on the display metrics of the resources.

### create

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)

```
public static @NonNull RoundedBitmapDrawable create(@NonNull Resources res, @NonNull String filepath)
```

Returns a new drawable, creating it by opening a given file path and decoding the bitmap.

### create

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)

```
public static @NonNull RoundedBitmapDrawable create(@NonNull Resources res, @NonNull InputStream is)
```

Returns a new drawable, creating it by decoding a bitmap from the given input stream.