Skip to content

Instantly share code, notes, and snippets.

View Firsto's full-sized avatar
☄️
I may be slow to respond.

Roman Zaostrovsky Firsto

☄️
I may be slow to respond.
View GitHub Profile
@Firsto
Firsto / grayscale_imageview.java
Created November 6, 2017 12:03 — forked from nisrulz/grayscale_imageview.java
Apply grayscale filter to ImageView in android
ImageView imgview = (ImageView)findViewById(R.id.imageView_grayscale);
imgview.setImageBitmap(bitmap);
// Apply grayscale filter
ColorMatrix matrix = new ColorMatrix();
matrix.setSaturation(0);
ColorMatrixColorFilter filter = new ColorMatrixColorFilter(matrix);
imgview.setColorFilter(filter);