android Bitmap getByteCount和getRowBytes
2014-07-21 12:29
127 查看
今天做图像缓存需要计算Bitmap的所占的内存空间,于是研究了下Bitmap关于内存占用的API
1、getRowBytes:Since API Level 1,用于计算位图每一行所占用的内存字节数。
2、getByteCount:Since API Level 12,用于计算位图所占用的内存字节数。
经实测发现:getByteCount() = getRowBytes() * getHeight(),也就是说位图所占用的内存空间数等于位图的每一行所占用的空间数乘以位图的行数。
因为getByteCount要求的API版本较高,因此对于使用较低版本的开发者,在计算位图所占空间时上面的方法或许有帮助。
本文转自:http://blog.csdn.net/chtnj/article/details/8793761
1、getRowBytes:Since API Level 1,用于计算位图每一行所占用的内存字节数。
2、getByteCount:Since API Level 12,用于计算位图所占用的内存字节数。
经实测发现:getByteCount() = getRowBytes() * getHeight(),也就是说位图所占用的内存空间数等于位图的每一行所占用的空间数乘以位图的行数。
因为getByteCount要求的API版本较高,因此对于使用较低版本的开发者,在计算位图所占空间时上面的方法或许有帮助。
本文转自:http://blog.csdn.net/chtnj/article/details/8793761
相关文章推荐
- android Bitmap getByteCount和getRowBytes
- android Bitmap getByteCount和getRowBytes
- android Bitmap getByteCount和getRowBytes
- android Bitmap getByteCount和getRowBytes
- Android 计算Bitmap大小 getRowBytes和getByteCount()
- Android Bitmap计算大小 getRowBytes和getByteCount()
- BitMap的getRowBytes和getByteCount()
- int android.graphics.Bitmap.getRowBytes()
- Android bitmap位图旋转
- Android中Bitmap.createBitmap重载方总结 和 Android实现位图剪切
- understanding drawBitmapMesh on android
- Android中ListView.getCount()与ListView.getChildCount()区别和OnScrollListener()各个参数的区别
- Android Bitmap zoomIn/zoomOut/rotate ——图片的缩小,放大 和旋转
- Android Bitmap和Canvas
- Android Bitmap与Canvas
- Android当中的防锯齿(Bitmap & Canvas )
- android 保存bitmap到SD卡
- Android画图学习总结(二)——Bitmap
- android 中的 Bitmap 相关
- android中drawable转bitmap的两种方法