2012-08-12 38 views
0

当我保存在某些设备上拍摄的照片时,它会保存为一些奇怪的行。我不知道如何使这里是描述这种图像的外观:

enter image description here

我的代码完美的作品在大多数设备,但我们有我们的两个用户说话了以下设备。
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(); 

     } 

    } 

}; 

感谢您的帮助......

回答