Android examples for User Interface:ImageView
set Color Matrix for ImageView
//package com.java2s; import android.graphics.ColorMatrix; import android.graphics.ColorMatrixColorFilter; import android.widget.ImageView; public class Main { public static void setLocked(ImageView v) { ColorMatrix matrix = new ColorMatrix(); matrix.setSaturation(0); //0 means grayscale ColorMatrixColorFilter cf = new ColorMatrixColorFilter(matrix); v.setColorFilter(cf);/* ww w . ja va 2 s . c o m*/ v.setAlpha(128); // 128 = 0.5 } }