2013-12-10 2 views

답변

0

희망이

public byte[] convertBitmapToByteArray(Context context, Bitmap bitmap) { 
ByteArrayOutputStream buffer = new ByteArrayOutputStream(bitmap.getWidth() * bitmap.getHeight()); 
bitmap.compress(CompressFormat.PNG, 100, buffer); 
return buffer.toByteArray(); 

}

+0

안녕하세요,이 줄은 대답이지만이 줄은 \t \t \t \t ByteArrayOutputStream buffer = new ByteArrayOutputStream (bm.getWidth() * bm.getHeight()); 은 null을 반환하고 bitmap이 null이 아닌지 확인했습니다. 어떤 sugestions? – JoaoFilipeClementeMartins

관련 문제