0
當我保存在某些設備上拍攝的照片時,它會保存爲一些奇怪的行。我不知道如何使這裏是描述這種圖像的外觀:
我的代碼完美的作品在大多數設備,但我們有我們的兩個用戶說話了以下設備。
1. HTC霹靂
2. HTC啓發
有誰知道這是怎麼發生的?這裏是我的代碼:
Android位圖保存爲奇怪行
PictureCallback jpegCallback = new PictureCallback() {
public void onPictureTaken(byte[] data, Camera camera) {
mPreview.mCamera.startPreview();
Log.e(TAG, "onPictureTaken - jpegCallback");
try {
// start camera saving system
CameraPhoneStorageSystem camStorageSys = new CameraPhoneStorageSystem(
mContext);
FileOutputStream out = null;
String str = CameraPhoneStorageSystem
.returnImageNewNameForExternalMemory();
galleryAddPic(str);
out = new FileOutputStream(str);
// mutableBitmap.compress(CompressFormat.JPEG, 85, out);
out.write(data, 0, data.length);
out.flush();
out.close();
out = null;
Toast.makeText(mContext, "saved..", Toast.LENGTH_SHORT).show();
} catch (IOException e) {
Toast.makeText(
mContext,
"Error: Problem Saving Image.. Please check device memory",
Toast.LENGTH_SHORT).show();
Log.e("saving", "problem saving images", e);
} catch (Exception e) {
// fail
Log.d(TAG, "ERROR: " + e.getMessage());
} finally {
anyPicturesTaken = true;
progressBar.setVisibility(View.GONE);
snapButton.setVisibility(ImageButton.VISIBLE);
Runtime.getRuntime().gc();
}
}
};
感謝您的幫助......