Bitmap.AllocationByteCount 属性

定义

返回用于存储此位图像素的已分配内存的大小。

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

属性值

属性

注解

返回用于存储此位图像素的已分配内存的大小。

如果重复使用位图来解码大小较小的其他位图,或者手动重新配置,则此值可能大于结果 #getByteCount() 。 请参阅 #reconfigure(int, int, Config)#setWidth(int)#setHeight(int)#setConfig(Bitmap.Config)BitmapFactory.Options#inBitmap BitmapFactory.Options.inBitmap。 如果未以这种方式修改位图,则此值将与返回的 #getByteCount()位图相同。

此值不会在位图的生存期内更改。

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

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

适用于

另请参阅

  • <xref:Android.Graphics.Bitmap.Reconfigure(System.Int32%2c+System.Int32%2c+System.Int32)>