Android Bitmap to Byte Array Convert getBitmapData(Bitmap bmp)

Here you can find the source of getBitmapData(Bitmap bmp)

Description

get Bitmap Data

Declaration

public static byte[] getBitmapData(Bitmap bmp) 

Method Source Code

//package com.java2s;
import java.io.ByteArrayOutputStream;

import android.graphics.Bitmap;
import android.graphics.Bitmap.CompressFormat;

public class Main {
    public static byte[] getBitmapData(Bitmap bmp) {
        ByteArrayOutputStream bos = new ByteArrayOutputStream();
        bmp.compress(CompressFormat.JPEG, 100, bos);
        byte[] bitmapdata = bos.toByteArray();

        return bitmapdata;
    }/*from  w  ww. j  ava 2  s. c  o  m*/
}

Related

  1. bitmap2Bytes(Bitmap bm)
  2. bitmapToByteArray(Bitmap bmp)
  3. bitmapToBytes(Bitmap bm)
  4. bmpToByteArray(final Bitmap bmp, final boolean needRecycle)
  5. convertBitmapToByte(Bitmap bitmap)
  6. bitmapTobyte(Bitmap bmp)
  7. Bitmap2Bytes(Bitmap bm)
  8. bitmap2Bytes(Bitmap bitmap, Bitmap.CompressFormat mCompressFormat, final boolean needRecycle)
  9. bitmap2Bytes(Bitmap bm, Bitmap.CompressFormat format)