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 值。

适用于 . 的 android.graphics.Bitmap.setPixel(int, int, int)Java 文档

本页的某些部分是根据 Android 开放源代码项目创建和共享的工作进行的修改,并根据 Creative Commons 2.5 属性许可证中所述的术语使用。

适用于