小编And*_*ock的帖子

无法解码流java.io.FileNotFoundException/storage/emulated/0 open failed:ENOENT(没有这样的文件或目录

您好我正在尝试保存在我的应用程序上拍摄的照片,但是当我尝试访问内存以放置数据时,会出现错误

无法解码流java.io.FileNotFoundException/storage/emulated/0 open failed:ENOENT(没有这样的文件或目录)

这是我的代码.

            Camera.PictureCallback mPictureCallback = new Camera.PictureCallback() {

        public void onPictureTaken(byte[] data, Camera camera) {
            // TODO Auto-generated method stub
            if (data != null){
                //Intent mIntent = new Intent();
                //mIntent.putExtra("image",imageData);

                mCamera.stopPreview();
                mPreviewRunning = false;
                mCamera.release();

                 try{
                     BitmapFactory.Options opts = new BitmapFactory.Options();
                     Bitmap bitmap= BitmapFactory.decodeByteArray(data, 0, data.length,opts);
                     bitmap = Bitmap.createScaledBitmap(bitmap, 300, 300, false);
                     int width = bitmap.getWidth();
                     int height = bitmap.getHeight();
                     int newWidth = 300;
                     int newHeight = 300;

                     // calculate the scale - in this case = …
Run Code Online (Sandbox Code Playgroud)

eclipse android timer capture android-camera

4
推荐指数
1
解决办法
3万
查看次数

标签 统计

android ×1

android-camera ×1

capture ×1

eclipse ×1

timer ×1