1

HTC Incredible でCamera.takepicture()を呼び出して写真を撮ると、スクランブルされた画像が得られます。この問題は、アプリケーションをテストした他のデバイス (Galaxy SII、Galaxy S、Nexus S) では発生しません。今のところ自分で解決策を見つけることができていません...

リンクされた画像: http://i.stack.imgur.com/j4VE8.jpg (投稿するには、より多くの評判が必要です)

これは私のimageDataを保存する方法です:

    static boolean StoreByteImage(Context mContext, byte[] imageData,
        int quality, String expName) {

    File sdImageMainDirectory = new File("/sdcard");
    FileOutputStream fileOutputStream = null;
    //String nameFile;
    try {

        BitmapFactory.Options options=new BitmapFactory.Options();
        options.inSampleSize = 4;

        Bitmap myImage = BitmapFactory.decodeByteArray(imageData, 0,
                imageData.length,options);

        fileOutputStream = new FileOutputStream(
                sdImageMainDirectory.toString() +"/CapturedQRCode.jpg");

        BufferedOutputStream bos = new BufferedOutputStream(
                fileOutputStream);

        myImage.compress(CompressFormat.PNG, quality, bos);

        bos.flush();
        bos.close();

    } catch (FileNotFoundException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    } catch (IOException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }

    return true;
}

誰でもヒントを得ましたか?

4

0 に答える 0