decodeRegion

open override fun decodeRegion(region: Rect, sampleSize: Int, config: Bitmap.Config, reuse: Bitmap?): Bitmap?

Decodes a region of the image.

inBitmap is only set when reuse is mutable, config is not Bitmap.Config.HARDWARE and reuse has exactly the size of the decoded region, because a region decoder keeps the size of the reused bitmap, clipping or padding the decoded pixels otherwise.

Return

decoded bitmap, or null if decoding failed, the region is invalid or the source was closed.

Parameters

region

region to decode, expressed in stored pixels.

sampleSize

subsampling factor, a power of two.

config

bitmap configuration requested for the result.

reuse

bitmap that may be reused to hold the result, or null.