矢量Drawables vs Bitmap就RAM而言(Android)

Boo*_*unz 4 memory ram android vector bitmap

就绘图在屏幕上渲染时使用的RAM而言,如果drawable是矢量或位图,它会有什么不同吗?

我知道向量占用的存储空间较少,但我要求渲染它所需的RAM,因为从理论上讲,它仍然被绘制到最终具有相同像素数量的画布上.

谢谢!

toa*_*ran 6

从我以前读过的文件(与你同样的问题).这两个选项之间的不同之处在于你发布后的APK文件的大小.SVG将帮助您保存apk的大小.

The initial loading of a vector graphic can cost more CPU cycles than the corresponding raster image. Afterward, memory use and performance are similar between the two. We recommend that you limit a vector image to a maximum of 200 x 200 dp; otherwise, it can take too long to draw. 在视图上绘制将具有消耗相同RAM(存储器)的那两个选项.

我的参考资料来源:https://developer.android.com/studio/write/vector-asset-studio.html#about