Android Bitmap to Byte Array Convert bitmap2byte(Bitmap bitmap)

Here you can find the source of bitmap2byte(Bitmap bitmap)

Description

bitmapbyte

Declaration

public static byte[] bitmap2byte(Bitmap bitmap) 

Method Source Code

//package com.java2s;

import android.graphics.Bitmap;

import java.io.ByteArrayOutputStream;

public class Main {
    public static byte[] bitmap2byte(Bitmap bitmap) {
        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        bitmap.compress(Bitmap.CompressFormat.JPEG, 100, baos);
        return baos.toByteArray();
    }/*from w w  w.j a  v a2s.c om*/
}

Related

  1. Bitmap2Bytes(Bitmap bm)
  2. bitmap2Bytes(Bitmap bitmap, Bitmap.CompressFormat mCompressFormat, final boolean needRecycle)
  3. bitmap2Bytes(Bitmap bm, Bitmap.CompressFormat format)
  4. bmpToByteArray(final Bitmap bmp, final boolean needRecycle)
  5. convertBitmapToByteArray(Bitmap bitmap)
  6. putImagePath(String imagePath)
  7. getByteArrayFromImageUri(Activity ctx, Uri uri)
  8. bitmap2Bytes(Bitmap bitmap, Bitmap.CompressFormat mCompressFormat, final boolean needRecycle)
  9. bitmap2Bytes(Bitmap bm)