Android examples for android.graphics:Bitmap Load Save
get Byte array From Bitmap
import android.graphics.Bitmap; import android.graphics.BitmapFactory; import android.util.Base64; import android.util.Log; import java.io.ByteArrayOutputStream; public class Main{ public static final byte[] getBytesFromBitmap(Bitmap bitmap) { ByteArrayOutputStream stream = new ByteArrayOutputStream(); bitmap.compress(Bitmap.CompressFormat.JPEG, 100, stream); bitmap.recycle();//from w w w. ja v a 2 s . c om return stream.toByteArray(); } }