Android Guides | Samples

Android.Graphics.Bitmap.CreateBitmap Method

Returns a mutable bitmap with the specified width and height.

Syntax

[Android.Runtime.Register("createBitmap", "(Landroid/util/DisplayMetrics;IILandroid/graphics/Bitmap$Config;)Landroid/graphics/Bitmap;", "")]
public static Bitmap CreateBitmap (DisplayMetrics display, Int32 width, Int32 height, Bitmap+Config config)

Parameters

display
Display metrics for the display this bitmap will be drawn on.
width
The width of the bitmap
height
The height of the bitmap
config
The bitmap config to create.

Exceptions

TypeReason
IllegalArgumentExceptionif the width or height are <= 0

Remarks

Returns a mutable bitmap with the specified width and height. Its initial density is determined from the given DisplayMetrics.

[Android Documentation]

Requirements

Namespace: Android.Graphics
Assembly: Mono.Android (in Mono.Android.dll)
Assembly Versions: 0.0.0.0
Since: Added in API level 17