fromResource

Creates an image source from a raw drawable resource.

Return

created image source, which must be closed when no longer needed.

Parameters

resources

resources containing the drawable.

resId

identifier of the drawable resource.

Throws

if the resource cannot be read or its format is not supported.