get Bitmap Data - Android Graphics

Android examples for Graphics:Bitmap Byte Array

Description

get Bitmap Data

Demo Code


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

import android.graphics.Bitmap;

public class Main {

    public static byte[] getBitmapData(Bitmap photo) {
        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        photo.compress(Bitmap.CompressFormat.JPEG, 70, baos);
        return baos.toByteArray();
    }// w  w w .j  a v  a2s.  co  m
}

Related Tutorials