List of usage examples for android.graphics Bitmap compress
@WorkerThread public boolean compress(CompressFormat format, int quality, OutputStream stream)
From source file:Main.java
public static byte[] getBitmapInBytes(Bitmap b) { ByteArrayOutputStream stream = new ByteArrayOutputStream(); b.compress(Bitmap.CompressFormat.JPEG, 50, stream); return stream.toByteArray(); }
From source file:Main.java
public static byte[] Bitmap2Bytes(Bitmap bm) { ByteArrayOutputStream baos = new ByteArrayOutputStream(); bm.compress(CompressFormat.JPEG, 100, baos); return baos.toByteArray(); }
From source file:Main.java
public static byte[] bitmapToBytes(Bitmap bm) { ByteArrayOutputStream baos = new ByteArrayOutputStream(); bm.compress(Bitmap.CompressFormat.JPEG, 100, baos); return baos.toByteArray(); }
From source file:Main.java
public static byte[] bitmapToBytes(Bitmap bm) { ByteArrayOutputStream baos = new ByteArrayOutputStream(); bm.compress(Bitmap.CompressFormat.PNG, 100, baos); return baos.toByteArray(); }
From source file:Main.java
public static byte[] Bitmap2ByteArray(Bitmap bm) { ByteArrayOutputStream baos = new ByteArrayOutputStream(); bm.compress(Bitmap.CompressFormat.PNG, 100, baos); return baos.toByteArray(); }
From source file:Main.java
public static ByteArrayInputStream Bitmap2ByteArrayInputStream(Bitmap bm) { ByteArrayOutputStream baos = new ByteArrayOutputStream(); bm.compress(Bitmap.CompressFormat.JPEG, 100, baos); return new ByteArrayInputStream(baos.toByteArray()); }
From source file:Main.java
public static byte[] bitmapToByte(Bitmap bm) { ByteArrayOutputStream baos = new ByteArrayOutputStream(); bm.compress(Bitmap.CompressFormat.PNG, 100, baos); return baos.toByteArray(); }
From source file:Main.java
public static byte[] bitmap2Bytes(Bitmap bm) { ByteArrayOutputStream baos = new ByteArrayOutputStream(); bm.compress(CompressFormat.PNG, 100, baos); return baos.toByteArray(); }
From source file:Main.java
public static byte[] changeBitmapToByte(Bitmap bm) { ByteArrayOutputStream baOut = new ByteArrayOutputStream(); bm.compress(CompressFormat.PNG, 100, baOut); return baOut.toByteArray(); }
From source file:Main.java
public static byte[] bitmapToByteArray(Bitmap bitmap) { ByteArrayOutputStream os = new ByteArrayOutputStream(); bitmap.compress(Bitmap.CompressFormat.PNG, 100, os); return os.toByteArray(); }