Android.Graphics.Bitmap.SetPixel Method

Syntax

[Android.Runtime.Register("setPixel", "(III)V", "")]
public void SetPixel (int x, int y, Color color)

Parameters

x
The x coordinate of the pixel to replace (0...width-1)
y
The y coordinate of the pixel to replace (0...height-1)
color
The ARGB color to write into the bitmap

Exceptions

TypeReason
Java.Lang.IllegalStateExceptionif the bitmap is not mutable
Java.Lang.IllegalArgumentExceptionif x, y are outside of the bitmap's bounds.

Remarks

Write the specified Android.Graphics._Color into the bitmap (assuming it is mutable) at the x,y coordinate. The color must be 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