Android Guides | Samples

Android.Graphics.Bitmap.GetPixel Method

Returns the _Color at the specified location.

Syntax

[Android.Runtime.Register("getPixel", "(II)I", "")]
public Int32 GetPixel (Int32 x, Int32 y)

Parameters

x
The x coordinate (0...width-1) of the pixel to return
y
The y coordinate (0...height-1) of the pixel to return

Exceptions

TypeReason
IllegalArgumentExceptionif x, y exceed the bitmap's bounds

Remarks

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). The returned color is a non-premultiplied ARGB value.

[Android Documentation]

Requirements

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