Bitmap.SetPixel(Int32, Int32, Color) 方法

定义

在 x,y 坐标处将指定的指定 Color 写入位图(假设它是可变的)。

[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

参数

x
Int32

要替换的像素的 x 坐标(0...width-1)

y
Int32

要替换的像素的 y 坐标(0...height-1)

color
Color

要写入位图的 ARGB 颜色

属性

例外

如果位图不可可变,则为

如果 x,则 y 不在位图边界之外。

注解

在 x,y 坐标处将指定的指定 Color 写入位图(假设它是可变的)。 颜色必须是颜色空间中的 ColorSpace.Named#SRGB sRGB 非预乘 ARGB 值。

Java文档android.graphics.Bitmap.setPixel(int, int, int)

本页的某些部分是根据 创建和共享的工作进行的修改,并根据 许可证中所述的条款使用。

适用于