美文网首页
android paint滤镜API

android paint滤镜API

作者: hello_math | 来源:发表于2016-09-09 09:32 被阅读88次

ColorMatrix colorMatrix =newColorMatrix(

newfloat[]{1, 0, 0, 0, 0,

                0, 1, 0, 0, 0,

                0, 0, 1, 0, 0,

                0, 0, 0, 1, 0});

mPaint.setColorFilter(newColorMatrixColorFilter(colorMatrix));

mPaint.setColor(Color.argb(255, 255, 128, 103));

canvas.drawCircle(240, 600 / 2, 200, mPaint);

Bitmap bitmap=BitmapFactory.decodeResource(mContext.getResources(), R.drawable.kale);

canvas.drawBitmap(bitmap,240,600,mPaint);

canvas真正的画笔颜色为colorMatrix*(255, 255, 128, 103,1)。颜色混合即滤镜。

相关文章

网友评论

      本文标题:android paint滤镜API

      本文链接:https://www.haomeiwen.com/subject/auseettx.html