문제

Is it possible to just capture the image, but not saving it and instead use right away the bitmap captured to do image processing techniques.

My point is, its much easier than reading the saved file, then converting it to a bitmap for usage in image processing.

I've implemented the built-in camera in android.

도움이 되었습니까?

해결책

Here is what I would do.

   protected void onActivityResult(int requestCode, int resultCode, Intent data)
    {
        super.onActivityResult(requestCode, resultCode, data);
        if (resultCode == RESULT_OK)
        {
            Uri pictureUri = data.getData();
            Bitmap bitmap = MediaStore.Images.Media.getBitmap(this.getContentResolver(), pictureUri);

getContentResolver().delete(Utils.pictureUri, null, null);
        }
    }

Here what I did was create a Bitmap object to hold the current image. Once you get it in bitmap. You can delete the the file. I have not tried this but I think this is what you are trying to achieve.

다른 팁

The MediaStore.ACTION_IMAGE_CAPTURE intent saves the captured picture to disk. Often, the intent allows you to choose the directory where the captured image will be stored. You can try to use /dev/null, but YMMV. Please remember that the bitmap that the intent returns to your onActivityResult() is a small thumbnail, intended to be displayed in a list of images. If you want access to reasonable resolution, you either need to read the saved file, or implement a custom camera. Note that for many purposes you don't need to capture a picture at all, some preview frame may be enough. Most current devices support VGA (640x480) preview, and many modern devices support up 1920x1080 preview resolution.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top