public static String saveBitmapToJpeg(Context context,Bitmap bitmap, String name){
File storage = context.getCacheDir(); // 이 부분이 임시파일 저장 경로
String fileName = name + ".jpg"; // 파일이름은 마음대로!
File tempFile = new File(storage,fileName);
try{
tempFile.createNewFile(); // 파일을 생성해주고
FileOutputStream out = new FileOutputStream(tempFile);
bitmap.compress(Bitmap.CompressFormat.JPEG, 90 , out); // 넘거 받은 bitmap을 jpeg(손실압축)으로 저장해줌
out.close(); // 마무리로 닫아줍니다.
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
return tempFile.getAbsolutePath(); // 임시파일 저장경로를 리턴해주면 끝!
}
http://pjkstory.blogspot.com/2016/05/android-bitmap.html -출처
위 함수에서 제가 리사이즈 하고싶은 이미지경로는 어디에 넣어줘야하는 건가요?
그리고 함수 파라미터 context하고 bitmap에 뭐 넣어야 하는지 모르겠어요ㅜ