Code example for Paint

Methods: setColorFilter

0
            c.drawRect(0, 0, mMapPin.getWidth(), mMapPin.getHeight(), sClearerPaint);
 
            // 1 - Draw the base 
            c.drawBitmap(mBase, 0, 0, null);
            // 2 - Draw the pin on top of it 
            mPaint.setColorFilter(new LightingColorFilter(Color.BLACK, mCurrentPinColor));
            c.drawBitmap(mPin, 0, 0, mPaint);
            // 3 - Draw the dot on top of everything 
            mPaint.setColorFilter(new LightingColorFilter(Color.BLACK, mCurrentDotColor));
            c.drawBitmap(mDot, 0, 0, mPaint);
 
            mNeedRebuild = false;
        } 
 
        canvas.drawBitmap(mMapPin, null, getBounds(), mMapPinPaint);
    } 
 
    @Override 
    public void setAlpha(int alpha) {
        mMapPinPaint.setAlpha(alpha);
    }