ColorFilter(native)
Manages drawing of color in bitmap file. This object is usually set in Paint object.
Example
var paint = new Paint(); // create color filter for grayscale images var colorFilter = ColorFilter.grayscale(); // apply color filter to the paint object paint.colorFilter = colorFilter; // load bitmap file var bitmap = Bitmap.fromFile("dat://moscrif.jpg"); // draw bitmap converted to grayscale canvas.drawBitmap(bitmap, System.width / 2 - bitmap.width / 2, System.height / 2 - bitmap.height / 2, paint);
Methods
-
grayscale() : ColorFilter
If this filter is used, bitmap is drawn in grayscale colors.
-
lighting(mul, add) : ColorFilter
Create a colorfilter that multiplies the RGB channels by one color, and then adds a second color, pinning the result for each component to [0..255]. The alpha components of the mul and add arguments are ignored.