2012-06-26 3 views
1

종류가되어야합니다. 이것은 첫 번째 게시물입니다.비트 맵이 반환되었으므로, 위도는

자르기 의도가 있고 비트 맵을 ImageView에 할당했습니다. 하지만 내가 원하는 것은 새 비트 맵의 ​​URI입니다.

어떻게하면 '사진'var에서 Uri를 가져 오거나 의도 한 결과와 함께 URI를 반환 할 수 있습니까?

protected void onActivityResult(int requestCode, int resultCode, Intent data)  

    case CROP_FROM_CAMERA: 
     Log.d(TAG, "Returned from Crop"); 
     Bundle extras = data.getExtras(); 

     Uri uriCropped = data.getData(); 

     if (extras != null) {    
      Bitmap photo = extras.getParcelable("data"); 
      Log.d(TAG, "Setting Crop preview with URI: " + uriCropped); 
      ImageView mImageView2 = (ImageView) findViewById(R.id.mImageView); 
      mImageView2.setImageURI(uriCropped); 


     } 

     File f = new File(mImageCaptureUri.getPath());    
     if (f.exists()) f.delete(); 

     startX(<URI of 'photo' needed>); 
     break; 

미리 감사드립니다.

답변

0

photo var는 메모리에만 존재하므로 Uri가 없습니다. Uri가 장치 저장 장치에 저장하고 Uri.fromFile(File file)으로 검색 할 필요가있는 경우를 대비하여.

+0

사비, 귀하의 도움과 빠른 응답을 위해 대단히 감사합니다. 치료를 했어. – Jele

관련 문제