Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unable to change color of stikcer view with setColorFilter #20

Open
hrgdeveloper opened this issue Feb 26, 2017 · 1 comment
Open

unable to change color of stikcer view with setColorFilter #20

hrgdeveloper opened this issue Feb 26, 2017 · 1 comment

Comments

@hrgdeveloper
Copy link

i'am not sure why setColorFilter is not working at all on stikcers .. can any body help me please

@devraajdeveloper
Copy link

devraajdeveloper commented Feb 17, 2018

You can't do it directly (Add color programmatically)

================================================

private void changeBitmapColor(Bitmap sourceBitmap, String color) {

    Bitmap resultBitmap = Bitmap.createBitmap(sourceBitmap, 0, 0,
            sourceBitmap.getWidth() - 1, sourceBitmap.getHeight() - 1);
    Paint p = new Paint();
    ColorFilter filter = new LightingColorFilter(Color.parseColor(color), 1);
    p.setColorFilter(filter);
    mCurrentView.setBitmap(resultBitmap);
    Canvas canvas = new Canvas(resultBitmap);
    canvas.drawBitmap(resultBitmap, 0, 0, p);
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants