Android Bitmap to Byte Array Convert convertBitmapToByte(Bitmap bitmap)

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

Description

convert Bitmap To Byte

Declaration

public static byte[] convertBitmapToByte(Bitmap bitmap) 

Method Source Code

//package com.java2s;

import android.graphics.Bitmap;

import java.io.ByteArrayOutputStream;

public class Main {
    public static byte[] convertBitmapToByte(Bitmap bitmap) {
        ByteArrayOutputStream stream = new ByteArrayOutputStream();
        bitmap.compress(Bitmap.CompressFormat.PNG, 100, stream);
        return stream.toByteArray();
    }//w  w w .  j  a v  a2  s.  co m
}

Related

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