嗨,我想在 Android 中将普通位图转换为单色位图,我该怎么做。我试图在网上查找,但只能找到
Bitmap bmpMonochrome = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888);
Canvas canvas = new Canvas(bmpMonochrome);
ColorMatrix ma = new ColorMatrix();
ma.setSaturation(0);
Paint paint = new Paint();
paint.setColorFilter(new ColorMatrixColorFilter(ma));
canvas.drawBitmap(bmpSrc, 0, 0, paint);
我想传递一个位图并作为回报赌单色位图的字节数组。
public static byte[] toBytes(Bitmap bitmap) {
}
任何指针或链接请
R