[android-developers] Re: How to invert colors within a region of a bitmap

2011-01-26 Thread sotcha
If you want to invert colors you have to use this table : float mx [] = { -1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, -1.0f, 0.0f, 1.0f, 0.0f, 0.0f, 0.0f, -1.0f, 1.0f, 0.0f, 1.0f, 1.0f, 1.0f, 1.0f, 0.0f }; --

[android-developers] Re: How to invert colors within a region of a bitmap

2009-07-21 Thread bseib
You can use a ColorMatrix in your paint brush to translate the RGBA values of your image. Here is a way of changing the hue 180 degrees (inverting color only), but preserving lightness and saturation: Canvas c = new Canvas(destBitmap); Paint p = new Paint(); float[] mx = { 0.0f, 0.5f, 0.5f,