java.lang.Object | |
↳ | android.graphics.BitmapFactory |
Creates Bitmap objects from various sources, including files, streams, and byte-arrays.
Nested Classes | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
BitmapFactory.Options |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Decode an immutable bitmap from the specified byte array.
| |||||||||||
Decode an immutable bitmap from the specified byte array.
| |||||||||||
Decode a file path into a bitmap.
| |||||||||||
Decode a file path into a bitmap.
| |||||||||||
Decode a bitmap from the file descriptor.
| |||||||||||
Decode a bitmap from the file descriptor.
| |||||||||||
Synonym for opening the given resource and calling
decodeResourceStream(Resources, TypedValue, InputStream, Rect, BitmapFactory.Options) . | |||||||||||
Synonym for
decodeResource(Resources, int, android.graphics.BitmapFactory.Options)
will null Options. | |||||||||||
Decode a new Bitmap from an InputStream.
| |||||||||||
Decode an input stream into a bitmap.
| |||||||||||
Decode an input stream into a bitmap.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
|
Decode an immutable bitmap from the specified byte array.
data | byte array of compressed image data |
---|---|
offset | offset into imageData for where the decoder should begin parsing. |
length | the number of bytes, beginning at offset, to parse |
opts | null-ok; Options that control downsampling and whether the image should be completely decoded, or just is size returned. |
Decode an immutable bitmap from the specified byte array.
data | byte array of compressed image data |
---|---|
offset | offset into imageData for where the decoder should begin parsing. |
length | the number of bytes, beginning at offset, to parse |
Decode a file path into a bitmap. If the specified file name is null, or cannot be decoded into a bitmap, the function returns null.
pathName | complete path name for the file to be decoded. |
---|
Decode a file path into a bitmap. If the specified file name is null, or cannot be decoded into a bitmap, the function returns null.
pathName | complete path name for the file to be decoded. |
---|---|
opts | null-ok; Options that control downsampling and whether the image should be completely decoded, or just is size returned. |
Decode a bitmap from the file descriptor. If the bitmap cannot be decoded return null. The position within the descriptor will not be changed when this returns, so the descriptor can be used again as is.
fd | The file descriptor containing the bitmap data to decode |
---|
Decode a bitmap from the file descriptor. If the bitmap cannot be decoded return null. The position within the descriptor will not be changed when this returns, so the descriptor can be used again as-is.
fd | The file descriptor containing the bitmap data to decode |
---|---|
outPadding | If not null, return the padding rect for the bitmap if it exists, otherwise set padding to [-1,-1,-1,-1]. If no bitmap is returned (null) then padding is unchanged. |
opts | null-ok; Options that control downsampling and whether the image should be completely decoded, or just its size returned. |
Synonym for opening the given resource and calling
decodeResourceStream(Resources, TypedValue, InputStream, Rect, BitmapFactory.Options)
.
res | The resources object containing the image data |
---|---|
id | The resource id of the image data |
opts | null-ok; Options that control downsampling and whether the image should be completely decoded, or just is size returned. |
Synonym for decodeResource(Resources, int, android.graphics.BitmapFactory.Options)
will null Options.
res | The resources object containing the image data |
---|---|
id | The resource id of the image data |
Decode a new Bitmap from an InputStream. This InputStream was obtained from resources, which we pass to be able to scale the bitmap accordingly.
Decode an input stream into a bitmap. If the input stream is null, or cannot be used to decode a bitmap, the function returns null. The stream's position will be where ever it was after the encoded data was read.
is | The input stream that holds the raw data to be decoded into a bitmap. |
---|
Decode an input stream into a bitmap. If the input stream is null, or cannot be used to decode a bitmap, the function returns null. The stream's position will be where ever it was after the encoded data was read.
is | The input stream that holds the raw data to be decoded into a bitmap. |
---|---|
outPadding | If not null, return the padding rect for the bitmap if it exists, otherwise set padding to [-1,-1,-1,-1]. If no bitmap is returned (null) then padding is unchanged. |
opts | null-ok; Options that control downsampling and whether the image should be completely decoded, or just is size returned. |
Prior to KITKAT
,
if is.markSupported()
returns true,
is.mark(1024)
would be called. As of
KITKAT
, this is no longer the case.