StickerView icon indicating copy to clipboard operation
StickerView copied to clipboard

unable to change color of stikcer view with setColorFilter

Open hrgdeveloper opened this issue 8 years ago • 1 comments

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

hrgdeveloper avatar Feb 26 '17 09:02 hrgdeveloper

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);
}

devraajdeveloper avatar Feb 17 '18 11:02 devraajdeveloper