카메라 의도에서 캡처 한 이미지를 표시하려고하는데 showPhoto 메서드를 호출하면 이미지가 ImageView에 표시되지 않습니다. 스택 추적에 오류 출력이 없으므로 문제를 어떻게 디버깅 할 수 있는지 잘 모르겠습니다.ImageView에서 캡처 한 이미지를 표시하는 방법은 무엇입니까?
캡쳐 된 이미지가 표시되지 않는 방법에 어떤 문제가 있는지 알고 있습니까? 이것은 내가 따라 한 튜토리얼
private void showPhoto(Uri photoUri) {
String filePath = photoUri.getEncodedPath();
File imageFile = new File(filePath);
//File imageFile = new File(photoUri.getPath());
if (imageFile.exists()){
Drawable oldDrawable = photoImage.getDrawable();
if (oldDrawable != null) {
((BitmapDrawable)oldDrawable).getBitmap().recycle();
}
Bitmap bitmap = BitmapFactory.decodeFile(imageFile.getAbsolutePath());
BitmapDrawable drawable = new BitmapDrawable(this.getResources(), bitmap);
photoImage.setScaleType(ImageView.ScaleType.FIT_CENTER);
photoImage.setImageDrawable(drawable);
}
}
: 다음과 같이
showPhoto 방법은 http://www.linux.com/learn/tutorials/722038-android-calling-the-camera가
I가 테스트하고있어이 장치는 JellyBean 4.1
있다가 이것이 전체에 대한 링크입니다 클래스 :
http://hastebin.com/oqokupulol.java
의 ImageView.setImageBitmap (비트 맵)를 사용하여로드합니다. 비트 맵의 품질을 낮춰보십시오. –