private void SaveBitmapToFileCache(Bitmap bitmap, String strFilePath) {
File fileCacheItem = new File(strFilePath);
OutputStream out = null;
try {
fileCacheItem.createNewFile();
out = new FileOutputStream(fileCacheItem);
bitmap.compress(CompressFormat.JPEG, 100, out);
}
catch (Exception e) {
e.printStackTrace();
} finally {
try {
out.close();
}
catch (IOException e)
{
e.printStackTrace();
}
}
}
출처 : http://snowbora.com/418
'안드로이드' 카테고리의 다른 글
[android] view,button등 동적 생성 (0) | 2013.02.28 |
---|---|
[android]간단한 쓰레드 사용법 (0) | 2013.02.28 |
[android] camera preview capture (0) | 2013.02.28 |
[android] 간단한 카메라 소스(autoFocus 포함) (1) | 2013.02.28 |
[android] 화면 터치 이벤트 처리 (0) | 2013.02.27 |