BitmapFactory.decodeFile을 사용하여 이미지의 비트 맵을 내 애플리케이션에로드하고 있습니다. 그러나이 함수는 큰 이미지 (예 : 카메라의 이미지)에 null을 반환합니다. 파일 경로가 확실히 정확합니다. 왜 null을 반환하는지 알 수 없습니다. supersampling을 시도했지만 도움이되지 않았습니다.Android에서 카메라 이미지를 비트 맵으로로드
왜이 작업을 수행 할 것인지 또는 카메라에서 가져온 이미지를 비트 맵에로드하는 방법을 쉽게 알 수 있습니까? 당신은 당신이 사용하는 코드의 조각 같은 문제에 대한 자세한 정보를 제공해야합니다
public static Bitmap loadBitmap(String filePath){
Bitmap result = BitmapFactory.decodeFile(filePath);
if(result == null){
if(filePath.contains(".jpg") || filePath.contains(".png")){
//This is the error that occurs when I attempt to load an image from the Camera DCIM folder or a large png I imported from my computer.
Utils.Toast("Could not load file -- too big?");
} else {
Utils.Toast("Could not load file -- image file type is not supported");
}
}
return result;
}
SDCard에 카메라 이미지를 저장합니까? 경로의 모든 디렉토리가 존재합니까? –
예, 이미지가 파일 브라우저를 통해 선택되므로 경로가 정확할 것입니다. 같은 폴더에서 선택한 다른 (더 작은) 이미지는 완벽하게 작동합니다. – GuyNoir
사용중인 코드를 제공해주십시오. – Cristian