0

私はandroid.givenでOpenGl Esに取り組んでいます.画像に影響を与えます.SDカードに画像を保存すると、黒い画像が表示されます.この問題をどのように解決しますか.

ファイル cacheDir; Toast.makeText(ImageProcessingActivity.this, "写真", 500).show();

                 Bitmap icon;
                 frame.setDrawingCacheEnabled(true);

                 icon = Bitmap.createBitmap(frame.getDrawingCache());
                 Bitmap bitmap = icon;
                 frame.setDrawingCacheEnabled(false);
                 // File mFile1 = Environment.getExternalStorageDirectory();
                 Date d = new Date();
                 String fileName = d.getTime() + "mg1.jpg";

                 File storagePath = (Environment.getExternalStorageDirectory());
                 File dest = new File(storagePath + "/CityAppImages");

                 if (!dest.exists()) {
                 dest.mkdirs();

                 }

                 File mFile2 = new File(dest, fileName);
                 sdpath = mFile2.getAbsolutePath();

                 Log.d("qqqqqqqqqqqqqqqqqqqqqqq", "zzzzzzzz" + sdpath);
                 try {
                 FileOutputStream outStream;

                 outStream = new FileOutputStream(mFile2);

                 bitmap.compress(Bitmap.CompressFormat.JPEG, 100, outStream);

                 outStream.flush();

                 outStream.close();
                 Toast.makeText(ImageProcessingActivity.this, "Photo Saved Sucessfully", 500)
                 .show();
                 image.setImageBitmap(bitmap);
                 } catch (FileNotFoundException e) {
                 // TODO Auto-generated catch block
                 e.printStackTrace();
                 } catch (IOException e) {

                 // TODO Auto-generated catch block
                 e.printStackTrace();
                 Toast.makeText(ImageProcessingActivity.this, "Photo Not Saved Sucessfully",500).show();
                 }
4

1 に答える 1