我想将照片存储在对象中,哪个更好?
- 将其存储为字节数组
- 将其存储为位图
我正在使用字节数组
在 OO 中,通常最好让您的类尽可能接近现实。位图比字节数组更接近照片的真实性。所以位图更好。
除非位图不能捕捉你所谓的照片的基本特征。说,您只需要将字节数组存储在某处。那么Bitmap就没有用了,只会使图片复杂化。但那不是照片。
If you aimed to store image only (remember ,store a byte array its not showing the image anyway )then storing image in byte array is good ,
but when it comes to show the image in some view you have to convert those byte array in bitmap which may occupied memory more then you direct store image in bitmap .
so over all bitmap is more convenient option , but again its totally up to your requirement