Public methods | |
---|---|
boolean | compress(Bitmap.CompressFormat format, int quality, OutputStream stream) Write a compressed version of the bitmap to the specified outputstream. |
Bitmap | copy(Bitmap.Config config, boolean isMutable) Tries to make a new bitmap based on the dimensions of this bitmap, setting the new bitmap's config to the one specified, and then copying this bitmap's pixels into the new bitmap. |
void | copyPixelsFromBuffer(Buffer src)
Copy the pixels from the buffer, beginning at the current position, overwriting the bitmap's pixels. |
void | copyPixelsToBuffer(Buffer dst)
Copy the bitmap's pixels into the specified buffer (allocated by the caller). |
static Bitmap | createBitmap(Bitmap source, int x, int y, int width, int height) Returns a bitmap from the specified subset of the source bitmap. |
static Bitmap | createBitmap(int[] colors, int width, int height, Bitmap.Config config) Returns a immutable bitmap with the specified width and height, with each pixel value set to the corresponding value in the colors array. |
static Bitmap | createBitmap(Bitmap source, int x, int y, int width, int height, Matrix m, boolean filter) Returns a bitmap from subset of the source bitmap, transformed by the optional matrix. |
static Bitmap | createBitmap(DisplayMetrics display, int width, int height, Bitmap.Config config, boolean hasAlpha, ColorSpace colorSpace) Returns a mutable bitmap with the specified width and height. |
static Bitmap | createBitmap(Bitmap src) Returns a bitmap from the source bitmap. |
static Bitmap | createBitmap(Picture source) Creates a Bitmap from the given |
static Bitmap | createBitmap(DisplayMetrics display, int[] colors, int offset, int stride, int width, int height, Bitmap.Config config) Returns a immutable bitmap with the specified width and height, with each pixel value set to the corresponding value in the colors array. |
static Bitmap | createBitmap(DisplayMetrics display, int[] colors, int width, int height, Bitmap.Config config) Returns a immutable bitmap with the specified width and height, with each pixel value set to the corresponding value in the colors array. |
static Bitmap | createBitmap(DisplayMetrics display, int width, int height, Bitmap.Config config) Returns a mutable bitmap with the specified width and height. |
static Bitmap | createBitmap(int[] colors, int offset, int stride, int width, int height, Bitmap.Config config) Returns a immutable bitmap with the specified width and height, with each pixel value set to the corresponding value in the colors array. |
static Bitmap | createBitmap(Picture source, int width, int height, Bitmap.Config config) Creates a Bitmap from the given |
static Bitmap | createBitmap(int width, int height, Bitmap.Config config, boolean hasAlpha, ColorSpace colorSpace) Returns a mutable bitmap with the specified width and height. |
static Bitmap | createBitmap(DisplayMetrics display, int width, int height, Bitmap.Config config, boolean hasAlpha) Returns a mutable bitmap with the specified width and height. |
static Bitmap | createBitmap(int width, int height, Bitmap.Config config) Returns a mutable bitmap with the specified width and height. |
static Bitmap | createBitmap(int width, int height, Bitmap.Config config, boolean hasAlpha) Returns a mutable bitmap with the specified width and height. |
static Bitmap | createScaledBitmap(Bitmap src, int dstWidth, int dstHeight, boolean filter) Creates a new bitmap, scaled from an existing bitmap, when possible. |
int | describeContents() No special parcel contents. |
void | eraseColor(int c) Fills the bitmap's pixels with the specified |
void | eraseColor(long color) Fills the bitmap's pixels with the specified |
Bitmap | extractAlpha() Returns a new bitmap that captures the alpha values of the original. |
Bitmap | extractAlpha(Paint paint, int[] offsetXY) Returns a new bitmap that captures the alpha values of the original. |
int | getAllocationByteCount() Returns the size of the allocated memory used to store this bitmap's pixels. |
int | getByteCount() Returns the minimum number of bytes that can be used to store this bitmap's pixels. |
Color | getColor(int x, int y) Returns the |
ColorSpace | getColorSpace() Returns the color space associated with this bitmap. |
Bitmap.Config | getConfig() If the bitmap's internal config is in one of the public formats, return that config, otherwise return null. |
int | getDensity()
Returns the density for this bitmap. |
int | getGenerationId() Returns the generation ID of this bitmap. |
int | getHeight() Returns the bitmap's height |
byte[] | getNinePatchChunk() Returns an optional array of private data, used by the UI system for some bitmaps. |
int | getPixel(int x, int y) Returns the |
void | getPixels(int[] pixels, int offset, int stride, int x, int y, int width, int height) Returns in pixels[] a copy of the data in the bitmap. |
int | getRowBytes() Return the number of bytes between rows in the bitmap's pixels. |
int | getScaledHeight(int targetDensity) Convenience method that returns the height of this bitmap divided by the density scale factor. |
int | getScaledHeight(Canvas canvas) Convenience for calling |
int | getScaledHeight(DisplayMetrics metrics) Convenience for calling |
int | getScaledWidth(int targetDensity) Convenience method that returns the width of this bitmap divided by the density scale factor. |
int | getScaledWidth(DisplayMetrics metrics) Convenience for calling |
int | getScaledWidth(Canvas canvas) Convenience for calling |
int | getWidth() Returns the bitmap's width |
boolean | hasAlpha() Returns true if the bitmap's config supports per-pixel alpha, and if the pixels may contain non-opaque alpha values. |
boolean | hasMipMap() Indicates whether the renderer responsible for drawing this bitmap should attempt to use mipmaps when this bitmap is drawn scaled down. |
boolean | isMutable() Returns true if the bitmap is marked as mutable (i.e. can be drawn into) |
boolean | isPremultiplied()
Indicates whether pixels stored in this bitmaps are stored pre-multiplied. |
boolean | isRecycled() Returns true if this bitmap has been recycled. |
void | prepareToDraw() Builds caches associated with the bitmap that are used for drawing it. |
void | reconfigure(int width, int height, Bitmap.Config config)
Modifies the bitmap to have a specified width, height, and |
void | recycle() Free the native object associated with this bitmap, and clear the reference to the pixel data. |
boolean | sameAs(Bitmap other) Given another bitmap, return true if it has the same dimensions, config, and pixel data as this bitmap. |
void | setColorSpace(ColorSpace colorSpace)
Modifies the bitmap to have the specified |
void | setConfig(Bitmap.Config config)
Convenience method for calling |
void | setDensity(int density)
Specifies the density for this bitmap. |
void | setHasAlpha(boolean hasAlpha) Tell the bitmap if all of the pixels are known to be opaque (false) or if some of the pixels may contain non-opaque alpha values (true). |
void | setHasMipMap(boolean hasMipMap) Set a hint for the renderer responsible for drawing this bitmap indicating that it should attempt to use mipmaps when this bitmap is drawn scaled down. |
void | setHeight(int height)
Convenience method for calling |
void | setPixel(int x, int y, int color)
Write the specified |
void | setPixels(int[] pixels, int offset, int stride, int x, int y, int width, int height)
Replace pixels in the bitmap with the colors in the array. |
void | setPremultiplied(boolean premultiplied) Sets whether the bitmap should treat its data as pre-multiplied. |
void | setWidth(int width)
Convenience method for calling |
static Bitmap | wrapHardwareBuffer(HardwareBuffer hardwareBuffer, ColorSpace colorSpace) Create a hardware bitmap backed by a |
void | writeToParcel(Parcel p, int flags) Write the bitmap and its pixels to the parcel. |