갤러리에 저장된 이미지를 불러와 비트맵으로 변화시킵니다.

Intent intent = new Intent(Intent.ACTION_PICK) ;

intent.setDataAndType(MediaStore.Images.Media.EXTERNAL_CONTENT_URI, MediaStore.Images.Media.CONTENT_TYPE) ;

startActivityForResult(intent, 0);


위 소스를 이용해서 갤러리를 띄우고

@Override

    public void onActivityResult( int requestCode, int resultCode, Intent data ) {  

        

        if( requestCode == 0 ) {  

        if(data != null) {

            try {

            Uri selPhotoUri = getNewTempPhotoUri(data.getData());

            Bitmap selPhoto = Images.Media.getBitmap(getContentResolver(), selPhotoUri);

            selPhoto = Bitmap.createScaledBitmap(selPhoto, 100, 100, true);

            

            imagebutton_user.setImageBitmap(selPhoto) ;

            check_photo = 1;

           } catch (IOException e) 

   {

   } 

        }

        }  

    }

onActivityResult 에서 비트맵을 로드합니다.

Images.Media.getBitmap(getContentResolver(), selPhotoUri); <--이부분 비트맵을 로드하는 부분에서 

Out of Memory 오류가 발생합니다. 사진의 용량이 3M이상이라 Out of Memory가 발생하는데 해결하기 위해 자료를

찾아보니 잘나오지가 않네요 해결방법으로 제시된걸 보니 전부 아래와같이 옵션을 이용해서 해결을 하도록 설명이 되어있는데

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

options.inSampleSize = 4;

Bitmap orgImage = BitmapFactory.decodeFile(“/sdcard/test.jpg”, options);

제가 궁금한건  data.getData() 로얻은 Uri로 BitmapFactory.decodeFile()에 어떻게 적용을 시키느냐입니다.
아님 다른 해결방안이 있을까요??? 해결할려고하니 너무 안되네요 도움 부탁합니다. ^^