Android Guides | Samples

Android.Graphics.Bitmap Class

See Also: Bitmap Members

Syntax

[Android.Runtime.Register("android/graphics/Bitmap", DoNotGenerateAcw=true)]
public sealed class Bitmap : Object, IParcelable, IDisposable

Remarks

Requirements

Namespace: Android.Graphics
Assembly: Mono.Android (in Mono.Android.dll)
Assembly Versions: 0.0.0.0

The members of Android.Graphics.Bitmap are listed below.

See Also: Inherited members from Java.Lang.Object

Public Fields

const
DensityNoneint (0). Indicates that the bitmap was created for an unknown pixel density.

Public Properties

[read-only]
AllocationByteCountint. Returns the size of the allocated memory used to store this bitmap's pixels.
[read-only]
ByteCountint. Returns the minimum number of bytes that can be used to store this bitmap's pixels.
[read-only]
static
CreatorIParcelableCreator.
Densityint.
[read-only]
GenerationIdint. Returns the generation ID of this bitmap.
HasAlphabool. Returns true if the bitmap's config supports per-pixel alpha, and if the pixels may contain non-opaque alpha values.
HasMipMapbool. Indicates whether the renderer responsible for drawing this bitmap should attempt to use mipmaps when this bitmap is drawn scaled down.
Heightint. Returns the bitmap's height
[read-only]
IsMutablebool. Returns true if the bitmap is marked as mutable (i.e. can be drawn into)
[read-only]
IsRecycledbool. Returns true if this bitmap has been recycled.
Premultipliedbool.
[read-only]
RowBytesint. Return the number of bytes between rows in the bitmap's pixels.
Widthint. Returns the bitmap's width

Protected Properties

[read-only]
override
ThresholdClassIntPtr. This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.
[read-only]
override
ThresholdTypeType. This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.

Public Methods

Compress(CompressFormat, int, Stream) : bool
Write a compressed version of the bitmap to the specified outputstream.
CompressAsync(CompressFormat, int, Stream) : System.Threading.Tasks.Task<bool>
Copy(Config, bool) : Bitmap
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.
CopyPixelsFromBuffer(Buffer)
CopyPixelsFromBufferAsync(Buffer) : Task
CopyPixelsToBuffer(Buffer)
CopyPixelsToBufferAsync(Buffer) : Task
static
CreateBitmap(Bitmap) : Bitmap
Returns an immutable bitmap from the source bitmap.
static
CreateBitmap(int, int, Config) : Bitmap
Returns a mutable bitmap with the specified width and height.
static
CreateBitmap(DisplayMetrics, int, int, Config) : Bitmap
Returns a mutable bitmap with the specified width and height.
static
CreateBitmap(int[], int, int, Config) : Bitmap
Returns a immutable bitmap with the specified width and height, with each pixel value set to the corresponding value in the colors array.
static
CreateBitmap(Bitmap, int, int, int, int) : Bitmap
Returns an immutable bitmap from the specified subset of the source bitmap.
static
CreateBitmap(DisplayMetrics, int[], int, int, Config) : Bitmap
Returns a immutable bitmap with the specified width and height, with each pixel value set to the corresponding value in the colors array.
static
CreateBitmap(int[], int, int, int, int, Config) : Bitmap
Returns a immutable bitmap with the specified width and height, with each pixel value set to the corresponding value in the colors array.
static
CreateBitmap(Bitmap, int, int, int, int, Matrix, bool) : Bitmap
Returns an immutable bitmap from subset of the source bitmap, transformed by the optional matrix.
static
CreateBitmap(DisplayMetrics, int[], int, int, int, int, Config) : Bitmap
Returns a immutable bitmap with the specified width and height, with each pixel value set to the corresponding value in the colors array.
static
CreateScaledBitmap(Bitmap, int, int, bool) : Bitmap
Creates a new bitmap, scaled from an existing bitmap, when possible.
DescribeContents() : int
No special parcel contents.
EraseColor(int)
Fills the bitmap's pixels with the specified _Color.
ExtractAlpha() : Bitmap
Returns a new bitmap that captures the alpha values of the original.
ExtractAlpha(Paint, int[]) : Bitmap
Returns a new bitmap that captures the alpha values of the original.
GetBitmapInfo() : AndroidBitmapInfo
GetConfig() : Config
If the bitmap's internal config is in one of the public formats, return that config, otherwise return null.
GetNinePatchChunk() : byte[]
Returns an optional array of private data, used by the UI system for some bitmaps.
GetPixel(int, int) : int
Returns the _Color at the specified location.
GetPixels(int[], int, int, int, int, int, int)
Returns in pixels[] a copy of the data in the bitmap.
GetScaledHeight(Canvas) : int
Convenience for calling Bitmap.GetScaledHeight(int) with the target density of the given Canvas.
GetScaledHeight(DisplayMetrics) : int
Convenience for calling Bitmap.GetScaledHeight(int) with the target density of the given DisplayMetrics.
GetScaledHeight(int) : int
Convenience method that returns the height of this bitmap divided by the density scale factor.
GetScaledWidth(Canvas) : int
Convenience for calling Bitmap.GetScaledWidth(int) with the target density of the given Canvas.
GetScaledWidth(DisplayMetrics) : int
Convenience for calling Bitmap.GetScaledWidth(int) with the target density of the given DisplayMetrics.
GetScaledWidth(int) : int
Convenience method that returns the width of this bitmap divided by the density scale factor.
LockPixels() : IntPtr
PrepareToDraw()
Rebuilds any caches associated with the bitmap that are used for drawing it.
Reconfigure(int, int, Config)
Recycle()
Free the native object associated with this bitmap, and clear the reference to the pixel data.
SameAs(Bitmap) : bool
Given another bitmap, return true if it has the same dimensions, config, and pixel data as this bitmap.
SetConfig(Config)
SetPixel(int, int, Color)
SetPixels(int[], int, int, int, int, int, int)
UnlockPixels()
WriteToParcel(Parcel, ParcelableWriteFlags)
Write the bitmap and its pixels to the parcel.