3
onPreviewFrame()コールバックのコードは次のとおりです。これで、JPEGファイルとしてデータを保存することができ、ブラウザで見ることができますが、Windows Picture Viewerでは見ることができません。私のコードに何か問題がありますか?Android(onPreviewFrame):NV21データをJPEGファイルとして保存
YuvImage im = new YuvImage(data, ImageFormat.NV21, size.width,
size.height, null);
Rect r = new Rect(0,0,size.width,size.height);
ByteArrayOutputStream baos = new ByteArrayOutputStream();
im.compressToJpeg(r, parameters.getJpegQuality(), baos);
try{
FileOutputStream output = new FileOutputStream(String.format(
"/sdcard/%s_%d.jpg", strPrevCBType, System.currentTimeMillis()));
output.write(baos.toByteArray());
output.flush();
output.close();
}catch(FileNotFoundException e){
}catch(IOException e){
}
おかげで、私のコードは、現在取り組んでいる
artsylar