Android ColorMatrix - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Android ColorMatrix class.

This code example shows how to use the following methods: setSaturation
        mGlowColorPressedPaint.setMaskFilter(TableMaskFilter.CreateClipTable(0, 30));
        mGlowColorFocusedPaint.setColor(context.getTheme().resolveAttribute(
                android.R.attr.colorFocusedHighlight, value, true) ? value.data : 0xffff8e00);
        mGlowColorFocusedPaint.setMaskFilter(TableMaskFilter.CreateClipTable(0, 30));
 
        ColorMatrix cm = new ColorMatrix();
        cm.setSaturation(0.2f);
 
        mCanvas.setDrawFilter(new PaintFlagsDrawFilter(Paint.DITHER_FLAG,
                Paint.FILTER_BITMAP_FLAG));
    } 
 
    public Drawable createIconDrawable(Drawable src) {
        Bitmap scaled = createIconBitmap(src);
 
        StateListDrawable result = new StateListDrawable();
 
        result.addState(new int[] { android.R.attr.state_focused },
                new BitmapDrawable(createSelectedBitmap(scaled, false)));
        result.addState(new int[] { android.R.attr.state_pressed },
Full Snippet Info
7
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods: postConcat, reset
This code example shows how to use the following methods: postConcat, setSaturation
This code example shows how to use the following methods: getArray, postConcat, setRGB2YUV
 
        int r = Color.red(color);
        int g = Color.green(color);
        int b = Color.blue(color);
 
        ColorMatrix cm = new ColorMatrix();
        ColorMatrix tmp = new ColorMatrix();
 
        cm.setRGB2YUV();
        tmp.setRotate(0, deg);
        cm.postConcat(tmp);
        tmp.setYUV2RGB();
        cm.postConcat(tmp);
 
        final float[] a = cm.getArray();
 
        int ir = Math.round(a[0] * r +  a[1] * g +  a[2] * b);
        int ig = Math.round(a[5] * r +  a[6] * g +  a[7] * b);
        int ib = Math.round(a[10] * r + a[11] * g + a[12] * b);
 
Full Snippet Info
7
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods: set
				Bitmap.Config.RGB_565);
		Canvas c = new Canvas(bmpGrayscale);
		Paint paint = new Paint();
		paint.setColorFilter(null);
		c.drawBitmap(bmpGrayscale, 0, 0, paint);
		ColorMatrix cm = new ColorMatrix();
		getValueBlackAndWhite(); 
		cm.set(carray);
		ColorMatrixColorFilter f = new ColorMatrixColorFilter(cm);
		paint.setColorFilter(f);
		c.drawBitmap(bmpOriginal, 0, 0, paint);
		return bmpGrayscale;
	} 
 
	public static void getValueSaturation() 
	{ 
		// 高饱和度 
		carray[0] = 5;
		carray[1] = 0;
		carray[2] = 0;
Full Snippet Info
6
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE

Related Android ColorMatrix Questions & Answers:

See Code Examples for Android ColorMatrix Methods: