PictureCallback を使用して画像をキャプチャしています。そして、その正常に動作します。しかし、HTC Desire S では、適切なデータが返されません。次のような破損した画像を返します
これが私が使用したコードです
PictureCallback cameraPictureCallbackJpeg = new PictureCallback() {
@Override
public void onPictureTaken(byte[] data, Camera camera) {
FileOutputStream outStream = null;
try {
// write to local sandbox file system
// outStream =
// CameraDemo.this.openFileOutput(String.format("%d.jpg",
// System.currentTimeMillis()), 0);
// Or write to sdcard
outStream = new FileOutputStream(String.format(
"/sdcard/%d.jpg", System.currentTimeMillis()));
outStream.write(data);
outStream.close();
Log.e("error", "onPictureTaken - wrote bytes: " + data.length);
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
} finally {
}
}
他の方法を使用してデータをビットマップに変換したことをお伝えしなければなりません。前もって感謝します。私はここで立ち往生しています。どんな助けでも大歓迎です。