Android Reference
Bitmap.Config
android.graphics
Enum Bitmap.Config
-
- All Implemented Interfaces:
- Serializable, Comparable<Bitmap.Config>
- Enclosing class:
- Bitmap
public static enum Bitmap.Config
extends Enum<Bitmap.Config>
Possible bitmap configurations. A bitmap configuration describes
how pixels are stored. This affects the quality (color depth) as
well as the ability to display transparent/translucent colors.
-
-
Enum Constant Summary
Enum Constants
Enum Constant and Description |
ALPHA_8
Each pixel is stored as a single translucency (alpha) channel.
|
ARGB_4444
Deprecated.
Because of the poor quality of this configuration,
it is advised to use ARGB_8888 instead.
|
ARGB_8888
Each pixel is stored on 4 bytes.
|
RGB_565
Each pixel is stored on 2 bytes and only the RGB channels are
encoded: red is stored with 5 bits of precision (32 possible
values), green is stored with 6 bits of precision (64 possible
values) and blue is stored with 5 bits of precision.
|
-
Method Summary
Methods
Modifier and Type |
Method and Description |
static Bitmap.Config |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static Bitmap.Config[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
-
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, getSharedConstants, hashCode, name, ordinal, toString, valueOf
-
-
Enum Constant Detail
-
ALPHA_8
public static final Bitmap.Config ALPHA_8
Each pixel is stored as a single translucency (alpha) channel.
This is very useful to efficiently store masks for instance.
No color information is stored.
With this configuration, each pixel requires 1 byte of memory.
-
RGB_565
public static final Bitmap.Config RGB_565
Each pixel is stored on 2 bytes and only the RGB channels are
encoded: red is stored with 5 bits of precision (32 possible
values), green is stored with 6 bits of precision (64 possible
values) and blue is stored with 5 bits of precision.
This configuration can produce slight visual artifacts depending
on the configuration of the source. For instance, without
dithering, the result might show a greenish tint. To get better
results dithering should be applied.
This configuration may be useful when using opaque bitmaps
that do not require high color fidelity.
-
ARGB_8888
public static final Bitmap.Config ARGB_8888
Each pixel is stored on 4 bytes. Each channel (RGB and alpha
for translucency) is stored with 8 bits of precision (256
possible values.)
This configuration is very flexible and offers the best
quality. It should be used whenever possible.
-
Method Detail
-
valueOf
public static Bitmap.Config valueOf(String name)
Returns the enum constant of this type with the specified name.
The string must match exactly an identifier used to declare an
enum constant in this type. (Extraneous whitespace characters are
not permitted.)
- Parameters:
name
- the name of the enum constant to be returned.
- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum type has no constant
with the specified name
NullPointerException
- if the argument is null
Content
License.
All information of this service is derived from the free sources and is provided solely in the form of quotations.
This service provides information and interfaces solely for the familiarization (not ownership) and under the "as is" condition.
Copyright 2016 © ELTASK.COM. All rights reserved.
Site is optimized for mobile devices.
Downloads: 79 / 159523955. Delta: 0.03312 с