How can I convert from NV21 to JPEG. Currently, NV21 is the only previewFormat
that is supported by the camera on a Ne开发者_运维知识库xus One (running Android 2.2).
Thanks.
There is class to work with YUV images - YuvImage. And this class have method compressToJpeg. But it only for android 2.2. In more popular 2.1 there is no such class. So you need write code by yourself (for 2.1) to convert to rgb and than use Bitmap class. But you lucky to have 2.2 (I'm stuck with official 2.1 on htc hero forever =((( )
Btw, thank to google for "powerful" API.
p.setPreviewFormat(PixelFormat.JPEG);
no?
where p = Camera.getParameters();
精彩评论