Modify onDraw() method of MyView.java in the post "Example of using ColorMatrixColorFilter".
@Override
protected void onDraw(Canvas canvas) {
int mul = 0xFFFFFF00; //remove BLUE component
int add = 0x0000FF00; //set GREEN full
LightingColorFilter lightingColorFilter = new LightingColorFilter(mul, add);
Paint MyPaint_Normal = new Paint();
Paint MyPaint_Lighting = new Paint();
MyPaint_Lighting.setColorFilter(lightingColorFilter);
Bitmap myBitmap = BitmapFactory.decodeResource(getResources(), R.drawable.ic_launcher);
canvas.drawBitmap(myBitmap, 400, 100, MyPaint_Normal);
canvas.drawBitmap(myBitmap, 500, 100, MyPaint_Lighting);
};
Download the files.
Related:
- Adjust lightness and darkness of ImageView, using LightingColorFilter.
No comments:
Post a Comment