2011-09-29 2 views
0

ImageView에 이미지가 저장되어 있고 여러 프로세스 (뒤집기, 회전, 색상 수정 등) 후에 새 파일로 다시 저장됩니다. 그러나 ImageView에로드하고 곧바로 결과를 저장하면 다른 결과가 나타납니다. 첨부 된 이미지를 참고하십시오.ImageView에서 "깨끗한"이미지 검색

이미지 소스 enter image description here

이미지 결과 여기 enter image description here

어떻게 이미지 뷰에서 이미지를 추출하는 것 :

String filePath = Environment.getExternalStorageDirectory() 
+ File.separator + bufferPath; 
ByteArrayOutputStream bytes = new ByteArrayOutputStream(); 

selectedImage.setDrawingCacheEnabled(true); 
Bitmap bitmap = Bitmap.createBitmap(selectedImage.getDrawingCache()); 
selectedImage.setDrawingCacheEnabled(false); 

bitmap.compress(Bitmap.CompressFormat.JPEG, 100, bytes); 

imageFile = new File(filePath); 

//write the bytes in file 
FileOutputStream fo = new FileOutputStream(imageFile); 
fo.write(bytes.toByteArray()); 

이 결과 이미지와 동일하게 어떤 해결 방법이 출처? 다른 구성 요소, 아마도?

답변

1

조작을 수행하는 뒷면 Bitmap (원래 소스)을 잡습니다.

사용은 ImageView 단지 에이 Bitmap을 보여 - ImageView의 도면 캐시에 보관 된 후 확장 버전을 조작하지 않습니다.

+0

하하하, 네 말이 맞아, 그냥 ImageView를 디스플레이로 사용해야 해. – ariefbayu

관련 문제