开发者

Android pictures, filters and memory issues

开发者 https://www.devze.com 2023-02-09 01:32 出处:网络
Due to the fragmentation in camera equipment taking pictures seems to be not unproblematic. Especially taking pictures in full quality often times lead to memory problems. I don\'t own a device with

Due to the fragmentation in camera equipment taking pictures seems to be not unproblematic.

Especially taking pictures in full quality often times lead to memory problems. I don't own a device with a 8MP Camera, so I can't reliably test. Is there a bulletproof way of taking pictures in Android?

I also wrote a filter (sepia) that works well with smaller images. For full size images there are again some memory issues. For this I'm cre开发者_运维技巧ating an new bitmap with the same dimensions as the bitmap that needs to be filtered.

Bitmap filteredBitmap = Bitmap.createBitmap(bitmap.getWidth(), bitmap.getHeight(), Bitmap.Config.ARGB_8888);

It's clear that the app-memory isn't sufficient for two full size bitmaps. Is there another way I could create such a filter?


Bitmap.Config.ARGB_8888 gives you a 32 bit bitmap. If your taking pictures with the camera I don't see why you would need the alpha channel for those images. So you could use Bitmap.Config.RGB_565 instead and that should considerably reduce the size of your bitmaps.

0

精彩评论

暂无评论...
验证码 换一张
取 消