图片黑白化
2023-01-24 09:16:15 最后更新
//代码出自1335347584
//sbp("@chbar.jpg",bmp)
tot(1, bmp)

java(宽, bmp, "android.graphics.Bitmap.getWidth")
java(高, bmp, "android.graphics.Bitmap.getHeight")

javags(config,null,"android.graphics.Bitmap$Config","RGB_565")
java(图片,null,"android.graphics.Bitmap.createBitmap","int",宽,"int",高,"android.graphics.Bitmap$Config",config)
javanew(画板,"android.graphics.Canvas","android.graphics.Bitmap",图片)
javanew(paint,"android.graphics.Paint")
javanew(cm,"android.graphics.ColorMatrix")
java(null,cm,"android.graphics.ColorMatrix.setSaturation","float",0)
javanew(cmcf,"android.graphics.ColorMatrixColorFilter","android.graphics.ColorMatrix",cm)
java(null,paint,"android.graphics.Paint.setColorFilter","android.graphics.ColorFilter",cmcf)
java(null,画板,"android.graphics.Canvas.drawBitmap","android.graphics.Bitmap",bmp,"float",0,"float",0,"android.graphics.Paint",paint)

us(2,"src",图片)