Write a compressed version of the bitmap to the specified outputstream.
format The format of the compressed image quality Hint to the compressor, 0-100. 0 meaning compress for small size, 100 meaning compress for max quality. Some formats, like PNG which is lossless, will ignore the quality setting stream The outputstream to write the compressed data.
Copy the pixels from the buffer, beginning at the current position, overwriting the bitmap's pixels. The data in the buffer is not changed in any way (unlike setPixels(), which converts from unpremultipled 32bit to whatever the bitmap's native format is. bitmap: src:
Copy the bitmap's pixels into the specified buffer (allocated by the caller). An exception is thrown if the buffer is not large enough to hold all of the pixels (taking into account the number of bytes per pixel) or if the Buffer subclass is not one of the support types (ByteBuffer, ShortBuffer, IntBuffer). bitmap: dst:
Returns an immutable bitmap from subset of the source bitmap, transformed by the optional matrix. It is initialized with the same density as the original bitmap. source: x: y: width: height: m: filter: Return type: @return:
Returns an immutable bitmap from the specified subset of the source bitmap. The new bitmap may be the same object as source, or a copy may have been made. It is initialized with the same density as the original bitmap. source: x: y: width: height: Return type: @return:
Returns an immutable bitmap from the source bitmap. The new bitmap may be the same object as source, or a copy may have been made. It is initialized with the same density as the original bitmap. src: Return type: @return:
Creates a new bitmap, scaled from an existing bitmap. src The source bitmap. dstWidth The new bitmap's desired width. dstHeight The new bitmap's desired height. filter true if the source should be filtered. Return type: @return:the bitmap
Returns an optional array of private data, used by the UI system for some bitmaps. Not intended to be called by applications. bitmap: Return type: @return:
Returns the Color at the specified location. Throws an exception if x or y are out of bounds (negative or >= to the width or height respectively). bitmap: x: The x coordinate (0...width-1) of the pixel to return y: The y coordinate (0...height-1) of the pixel to return Return type: @return:The argb Color at the specified coordinate
Returns in pixels[] a copy of the data in the bitmap. Each value is a packed int representing a Color. The stride parameter allows the caller to allow for gaps in the returned pixels array between rows. For normal packed results, just pass width for the stride value bitmap: pixels: The array to receive the bitmap's colors offset: The first index to write into pixels[] stride: The number of entries in pixels[] to skip between rows (must be >= bitmap's width). Can be negative. x: The x coordinate of the first pixel to read from the bitmap y: The y coordinate of the first pixel to read from the bitmap The: number of pixels to read from each row height: The number of rows to read
Return the number of bytes between rows in the bitmap's pixels. Note that this refers to the pixels as stored natively by the bitmap. If you call getPixels() or setPixels(), then the pixels are uniformly treated as 32bit values, packed according to the Color class. bitmap: Return type: @return:number of bytes between rows of the native bitmap pixels.
Convenience method that returns the height of this bitmap divided by the density scale factor. bitmap: targetDensity: The density of the target canvas of the bitmap. Return type: @return:The scaled height of this bitmap, according to the density scale factor.
Convenience method that returns the width of this bitmap divided by the density scale factor. bitmap: targetDensity: The density of the target canvas of the bitmap. Return type: @return:The scaled width of this bitmap, according to the density scale factor.
getWidth (bitmapAsandroid.graphics.Bitmap) AsInt
Returns the bitmap's width bitmap: Return type: @return:
Returns true if the bitmap's config supports per-pixel alpha, and if the pixels may contain non-opaque alpha values. For some configs, this is always false (e.g. RGB_565), since they do not support per-pixel alpha. However, for configs that do, the bitmap may be flagged to be known that all of its pixels are opaque. In this case hasAlpha() will also return false. If a config such as ARGB_8888 is not so flagged, it will return true by default. bitmap: Return type: @return:
Returns true if this bitmap has been recycled. If so, then it is an error to try to access its pixels, and the bitmap will not draw. bitmap: Return type: @return:true if the bitmap has been recycled
JPEGAsString
PNGAsString
prepareToDraw (bitmapAsandroid.graphics.Bitmap)
Rebuilds any caches associated with the bitmap that are used for drawing it. In the case of purgeable bitmaps, this call will attempt to ensure that the pixels have been decoded. If this is called on more than one bitmap in sequence, the priority is given in LRU order (i.e. the last bitmap called will be given highest priority). For bitmaps with no associated caches, this call is effectively a no-op, and therefore is harmless. bitmap:
recycle (bitmapAsandroid.graphics.Bitmap)
Free the native object associated with this bitmap, and clear the reference to the pixel data. This will not free the pixel data synchronously; it simply allows it to be garbage collected if there are no other references. The bitmap is marked as "dead", meaning it will throw an exception if getPixels() or setPixels() is called, and will draw nothing. This operation cannot be reversed, so it should only be called if you are sure there are no further uses for the bitmap. This is an advanced call, and normally need not be called, since the normal GC process will free up this memory when there are no more references to this bitmap. bitmap:
Specifies the density for this bitmap. When the bitmap is drawn to a Canvas that also has a density, it will be scaled appropriately. bitmap: density: The density scaling factor to use with this bitmap or DENSITY_NONE if the density is unknown.
Replace pixels in the bitmap with the colors in the array. Each element in the array is a packed int prepresenting a Color bitmap: x: The x coordinate of the pixel to replace (0...width-1) y: The y coordinate of the pixel to replace (0...height-1) color: The Color to write into the bitmap
Replace pixels in the bitmap with the colors in the array. Each element in the array is a packed int prepresenting a Color bitmap: pixels: The colors to write to the bitmap offset: The index of the first color to read from pixels[] stride: The number of colors in pixels[] to skip between rows. Normally this value will be the same as the width of the bitmap, but it can be larger (or negative). x: The x coordinate of the first pixel to write to in the bitmap. y: The y coordinate of the first pixel to write to in the bitmap. width: The number of colors to copy from pixels[] per row height: The number of rows to write to the bitmap