我正在尝试更改触摸部分中图像的颜色。我尝试了以下两种方法,
1)
mPaint = new Paint();
mPaint.setColor(Color.RED);
mPaint.setStyle( Paint.Style.STROKE );
mPaint.setStrokeJoin( Paint.Join.ROUND );
mPaint.setStrokeCap( Paint.Cap.ROUND );
mPaint.setStrokeWidth( SettingsActivity.brushsize + 5);
mPaint.setFilterBitmap( false );
结果:在这种情况下混合没有发生,颜色完全覆盖图像。
2)
mPaint = new Paint();
ColorFilter filter = new LightingColorFilter(Color.RED, 1);
mPaint.setColorFilter(filter);
mPaint.setStyle( Paint.Style.STROKE );
mPaint.setStrokeJoin( Paint.Join.ROUND );
mPaint.setStrokeCap( Paint.Cap.ROUND );
mPaint.setStrokeWidth( 5);
mPaint.setFilterBitmap( false );
结果:我总是用这个观察黑色。
如何在图像的触摸部分执行颜色混合?