Android Bitmap to Byte Array Convert bitmapToBytes(Bitmap bm)

Here you can find the source of bitmapToBytes(Bitmap bm)

Description

bitmap To Bytes

License

Open Source License

Declaration

public static byte[] bitmapToBytes(Bitmap bm) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.io.ByteArrayOutputStream;
import android.graphics.Bitmap;

public class Main {
    public static byte[] bitmapToBytes(Bitmap bm) {
        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        bm.compress(Bitmap.CompressFormat.PNG, 100, baos);
        return baos.toByteArray();
    }/*from   www  .ja va 2 s. c  om*/
}

Related

  1. Bitmap2Bytes(Bitmap bm)
  2. bitmap2Bytes(Bitmap bm)
  3. bitmapToByteArray(Bitmap bmp)
  4. bmpToByteArray(final Bitmap bmp, final boolean needRecycle)
  5. convertBitmapToByte(Bitmap bitmap)
  6. getBitmapData(Bitmap bmp)
  7. bitmapTobyte(Bitmap bmp)