public class

BitmapUtils

extends Object
java.lang.Object
   ↳ com.pspdfkit.document.image.BitmapUtils

Class Overview

Extension to android.graphics.BitmapFactory that allows decoding bitmaps from content provider Uris.

Summary

Public Constructors
BitmapUtils()
Public Methods
static Bitmap decodeBitmap(Context context, Uri imageUri)
Read bitmap from an imageUri.
static Single<Bitmap> decodeBitmapAsync(Context context, Uri imageUri)
Decode bitmap from an imageUri asynchronously.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public BitmapUtils ()

Public Methods

public static Bitmap decodeBitmap (Context context, Uri imageUri)

Read bitmap from an imageUri. Accepts URI schemes accepted by openInputStream(Uri):

Parameters
context The context to use.
imageUri Uri from which to read the bitmap.
Returns
  • decoded bitmap data.
Throws
IOException When file could not be read.

public static Single<Bitmap> decodeBitmapAsync (Context context, Uri imageUri)

Decode bitmap from an imageUri asynchronously. Accepts URI schemes accepted by openInputStream(Uri):

Parameters
context The context to use.
imageUri Uri from which to read the bitmap.
Returns
  • Single observable returning decoded bitmap data.