1
카메라보기에서 가져온 이미지가 두 장 있고 카메라보기에서 이미지가 두 장 있습니다. SD 카드에이 두 이미지의 조합을 저장하고 싶습니다. 난을하면 zork zith 캔버스를 가지고 있다고 생각하지만 난 여기에Android : SD 카드에 jpeg/png로 캔버스 저장
output = new File(imagesFolder, fileName);
ImageView view = (ImageView) gameactivity.findViewById(R.id.imageView3);
view.setDrawingCacheEnabled(true);
Bitmap bitmap2 = view.getDrawingCache();
FileOutputStream fos = null;
try {
fos = new FileOutputStream(output);
fos.write(data);
fos.close();
} catch (FileNotFoundException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
catch (IOException e) {
e.printStackTrace();
}
try {
Bitmap bitmap = BitmapFactory.decodeFile(output.getAbsolutePath());
Canvas canvas = new Canvas(bitmap);
canvas.drawBitmap(bitmap2, null, null);
// HERE I HAVE TO SAVE THE CANVAS INTO JPEG
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
당신이 말해 주 시겠어요 내 코드입니다 FileOutputStream 또는
에 캔버스에서 데이터를 기록 JPEG 예에 캔버스를 저장하는 방법을 모른다 그것이 좋은 시작이라면? 내 문제를 해결하는 방법, 스택에 비슷한 게시물에 대한 좋은 답변을 찾을 수 없습니다 (내 캔버스를 그려보기를 원하지 않기 때문에)
네하지만이 같은 PNG에이 개 이미지를 저장하려면, 나는 내가 2의 FileOutputStream을 사용하는 비트 맵으로 변환 한 다음을 combinate한다고 생각 (여기 http://stackoverflow.com 에디 Talvala의 답변을 참조하십시오/questions/14712344/android-saving-photo-with-image-on-photo) 이전에 쓴 내용을 수행 했으므로 카메라가 찍은 사진이 아니라 비트 맵 만 저장합니다. – morg