Win an Ipad
  Developer   Documents   ColorFilter

ColorFilter

This article explains how to change grey scale or lighting of bitmap objects in Moscrif.

ColorFilter


ColorFilter class adjusts colours within Bitmap object, for example grey scale or lighting. It is used within Paint instance.

 

Following example demonstrates how to adjust alighting of bitmap picture:

app.onDraw = function(sender, canvas)
{
    var paint = new Paint();
    // create MaskFilter and apply it to the paint object
    paint.colorFilter = ColorFilter.lighting(250, 0xff00ff00);
    // use paint object with applied ColorFilter to draw bitmap
    canvas.drawBitmap(this._img, 0, 0, paint);
}

 

 Typeface   ColorFilter   MaskFilter 
Write a Comment (0)
Subject
Please complete this mandatory field.
HTML Tags Not Allowed!
Comment
Please complete this mandatory field.