Bitmap.RowBytes 属性

定义

返回位图像素中的行之间的字节数。

public int RowBytes { [Android.Runtime.Register("getRowBytes", "()I", "")] get; }
[<get: Android.Runtime.Register("getRowBytes", "()I", "")>]
member this.RowBytes : int

属性值

本机位图像素行之间的字节数。

属性

注解

返回位图像素中的行之间的字节数。 请注意,这是指位图以本机方式存储的像素。 如果调用 getPixels() 或 setPixels(),则像素将统一视为 32 位值,根据 Color 类打包。

因此 android.os.Build.VERSION_CODES#KITKAT,此方法不应用于计算位图的内存使用情况。 相反,请参阅 #getAllocationByteCount()

Java文档android.graphics.Bitmap.getRowBytes()

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

适用于