티스토리 뷰

비트맵 -> 바이트배열

Bitmap image; // 변환시킬 비트맵
ByteArrayOutputStream stream = new ByteArrayOutputStream();
image.compress(CompressFormat.JPEG , 100 , stream);
byte[] b = stream.toByteArray();



바이트배열 - > 비트맵

byte[] imgBuf = data; // 변환시킬 바이트 배열 Bitmap image = BitmapFactory.decodeByteArray( imgBuf , 0 , imgBuf.length);


댓글
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
«   2025/04   »
1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30
글 보관함