decodeToBitmapOrNull

Decode a file into a bitmap.

If cannot be decoded into a bitmap, the function returns null.

Receiver

File

Return

Bitmap or null.

Parameters

opts

the BitmapFactory.Options, default is null.

See also


Decode a file descriptor into a bitmap.

If cannot be decoded into a bitmap, the function returns null.

Receiver

FileDescriptor

Return

Bitmap or null.

Parameters

outPadding

set the padding of this bitmap, default is null, see BitmapFactory.decodeFileDescriptor.

opts

the BitmapFactory.Options, default is null.

See also


Decode a stream into a bitmap.

If cannot be decoded into a bitmap, the function returns null.

Receiver

InputStream

Return

Bitmap or null.

Parameters

outPadding

set the padding of this bitmap, default is null.

opts

the BitmapFactory.Options, default is null.

See also


fun ByteArray.decodeToBitmapOrNull(offset: Int = 0, size: Int = this.size): Bitmap?

Decode a byte array into a bitmap.

If cannot be decoded into a bitmap, the function returns null.

Receiver

ByteArray

Return

Bitmap or null.

Parameters

offset

the current offset, default is 0.

size

the current data length, default is ByteArray.size.

See also