Bitmap.GetPixel(Int32, Int32) Method

Definition

Returns the Color at the specified location.

[Android.Runtime.Register("getPixel", "(II)I", "")]
public int GetPixel (int x, int y);
[<Android.Runtime.Register("getPixel", "(II)I", "")>]
member this.GetPixel : int * int -> int

Parameters

x
Int32

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

y
Int32

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

Returns

The argb Color at the specified coordinate

Attributes

Exceptions

if 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 in the ColorSpace.Named#SRGB sRGB color space.

Java documentation for android.graphics.Bitmap.getPixel(int, int).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to