Android Guides | Samples

Android.Graphics.Bitmap Class

See Also: Bitmap

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: Object

Public Fields

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

Public Properties

[read-only]
AllocationByteCountInt32. Returns the size of the allocated memory used to store this bitmap's pixels.
[read-only]
ByteCountInt32. Returns the minimum number of bytes that can be used to store this bitmap's pixels.
[read-only]
static
CreatorIParcelableCreator.
DensityInt32.
[read-only]
GenerationIdInt32. Returns the generation ID of this bitmap.
HasAlphaBoolean. Returns true if the bitmap's config supports per-pixel alpha, and if the pixels may contain non-opaque alpha values.
HasMipMapBoolean. Indicates whether the renderer responsible for drawing this bitmap should attempt to use mipmaps when this bitmap is drawn scaled down.
HeightInt32. Returns the bitmap's height
[read-only]
IsMutableBoolean. Returns true if the bitmap is marked as mutable (i.e. can be drawn into)
[read-only]
IsRecycledBoolean. Returns true if this bitmap has been recycled.
PremultipliedBoolean. Indicates whether pixels stored in this bitmaps are stored pre-multiplied.
[read-only]
RowBytesInt32. Return the number of bytes between rows in the bitmap's pixels.
WidthInt32. 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(Bitmap+CompressFormat, Int32, Stream) : Boolean
Write a compressed version of the bitmap to the specified outputstream.
CompressAsync(Bitmap+CompressFormat, Int32, Stream) : System.Threading.Tasks.Task<bool>
Copy(Bitmap+Config, Boolean) : 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(Int32, Int32, Bitmap+Config) : Bitmap
Returns a mutable bitmap with the specified width and height.
static
CreateBitmap(DisplayMetrics, Int32, Int32, Bitmap+Config) : Bitmap
Returns a mutable bitmap with the specified width and height.
static
CreateBitmap(Int32[], Int32, Int32, Bitmap+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, Int32, Int32, Int32, Int32) : Bitmap
Returns an immutable bitmap from the specified subset of the source bitmap.
static
CreateBitmap(DisplayMetrics, Int32[], Int32, Int32, Bitmap+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(Int32[], Int32, Int32, Int32, Int32, Bitmap+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, Int32, Int32, Int32, Int32, Matrix, Boolean) : Bitmap
Returns an immutable bitmap from subset of the source bitmap, transformed by the optional matrix.
static
CreateBitmap(DisplayMetrics, Int32[], Int32, Int32, Int32, Int32, Bitmap+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, Int32, Int32, Boolean) : Bitmap
Creates a new bitmap, scaled from an existing bitmap, when possible.
DescribeContents() : Int32
No special parcel contents.
EraseColor(Int32)
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, Int32[]) : Bitmap
Returns a new bitmap that captures the alpha values of the original.
GetBitmapInfo() : AndroidBitmapInfo
GetConfig() : Bitmap+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(Int32, Int32) : Int32
Returns the _Color at the specified location.
GetPixels(Int32[], Int32, Int32, Int32, Int32, Int32, Int32)
Returns in pixels[] a copy of the data in the bitmap.
GetScaledHeight(Canvas) : Int32
Convenience for calling Bitmap.GetScaledHeight(Int32) with the target density of the given Canvas.
GetScaledHeight(DisplayMetrics) : Int32
Convenience for calling Bitmap.GetScaledHeight(Int32) with the target density of the given DisplayMetrics.
GetScaledHeight(Int32) : Int32
Convenience method that returns the height of this bitmap divided by the density scale factor.
GetScaledWidth(Canvas) : Int32
Convenience for calling Bitmap.GetScaledWidth(Int32) with the target density of the given Canvas.
GetScaledWidth(DisplayMetrics) : Int32
Convenience for calling Bitmap.GetScaledWidth(Int32) with the target density of the given DisplayMetrics.
GetScaledWidth(Int32) : Int32
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(Int32, Int32, Bitmap+Config)
Recycle()
Free the native object associated with this bitmap, and clear the reference to the pixel data.
SameAs(Bitmap) : Boolean
Given another bitmap, return true if it has the same dimensions, config, and pixel data as this bitmap.
SetConfig(Bitmap+Config)
SetPixel(Int32, Int32, Color)
SetPixels(Int32[], Int32, Int32, Int32, Int32, Int32, Int32)
UnlockPixels()
WriteToParcel(Parcel, ParcelableWriteFlags)
Write the bitmap and its pixels to the parcel.