2010-05-13 5 views

Répondre

2
ByteArrayOutputStream stream = new ByteArrayOutputStream(); 
mPhoto.compress(Bitmap.CompressFormat.JPEG /* FileType */, 
         100 /* Ratio */, stream);

HTH!

9
Drawable drawable; 

    Bitmap bitmap = ((BitmapDrawable) drawable).getBitmap(); 
    ByteArrayOutputStream stream = new ByteArrayOutputStream(); 
    bitmap.compress(Bitmap.CompressFormat.JPEG, 100, stream); 
    byte[] bitmapdata = stream.toByteArray(); 
Questions connexes