Android examples for android.graphics:PNG
get Bytes from PNG Bitmap
import java.io.ByteArrayOutputStream; import android.graphics.Bitmap; public class Main { public static byte[] getBytes(Bitmap bitmap) { ByteArrayOutputStream stream = new ByteArrayOutputStream(); bitmap.compress(Bitmap.CompressFormat.PNG, 0, stream); return stream.toByteArray(); }/*from www .ja v a 2 s . co m*/ }