Bitmap.SetPixel(Int32, Int32, Color) Method

Definition

Write the specified Color into the bitmap (assuming it is mutable) at the x,y coordinate.

[Android.Runtime.Register("setPixel", "(III)V", "")]
public void SetPixel (int x, int y, Android.Graphics.Color color);
[<Android.Runtime.Register("setPixel", "(III)V", "")>]
member this.SetPixel : int * int * Android.Graphics.Color -> unit

Parameters

x
Int32

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

y
Int32

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

color
Color

The ARGB color to write into the bitmap

Attributes

Exceptions

if the bitmap is not mutable

if x, y are outside of the bitmap's bounds.

Remarks

Write the specified Color into the bitmap (assuming it is mutable) at the x,y coordinate. The color must be a non-premultiplied ARGB value in the ColorSpace.Named#SRGB sRGB color space.

Java documentation for android.graphics.Bitmap.setPixel(int, 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