Wednesday, September 17, 2014

Converting Bitmap to Byte Array in Android

public byte[] convertBitmapToByteArray(Bitmap bitmap)
    {
        ByteArrayOutputStream stream = new ByteArrayOutputStream();

        bitmap.compress(Bitmap.CompressFormat.PNG, 100, stream);

        byte[] bitmapData = stream.toByteArray();

        return bitmapData;
    }

Converting Bitmap to Byte Array in Android Rating: 4.5 Diposkan Oleh: Unknown

0 comments:

Post a Comment