-
Notifications
You must be signed in to change notification settings - Fork 785
2019-09-10:如何计算一张图片所占的内存空间大小? #144
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
刚查了一下资料,总结如下: |
图片所占用的Bitmap大小计算方法,根据我们所放置图片的目录不同,所以图片多多少少长度和宽度会有一些变化,这个变化和我们所用的设备屏幕密度有关,因此可以根据图上的表来计算长和宽 原始图片宽度 实际显示图片宽度 然后根据我们所设置的像素类型ARGB_8888或RGB_888去乘上对应的1px所表示的byte从而得出图片所占用的内存。 |
图片占用内存大小=图片宽度图片高度图片位深 |
一张图片占用的内存大小的计算公式:分辨率 * 像素点大小;但分辨率不一定是原图的分辨率,需要结合一些场景来讨论,像素点大小就几种情况:ARGB_8888(4B)、RGB_565(2B) 等等。 |
No description provided.
The text was updated successfully, but these errors were encountered: