Code example for BitmapShader

0
		int w = right - left;
 
		if ( w > 0 && changed || mForceLayout ) {
			mRealRect = new Rect( mPaddingLeft, top, w - mPaddingRight, bottom );
			mIndicatorSmall = makeBitmap2( w / mSmallTicksCount, bottom - top, mLineTickSize );
			mShader = new BitmapShader( mIndicatorSmall, Shader.TileMode.REPEAT, Shader.TileMode.CLAMP );
			mIndicatorBig = makeBitmap3( mRealRect.width() / mBigTicksCount, bottom - top, mLineBigSize );
			mShader1 = new BitmapShader( mIndicatorBig, Shader.TileMode.REPEAT, Shader.TileMode.CLAMP );
			mIndicator = makeIndicator( bottom - top, mLineBigSize );
			mCorrectionX = (((float)mRealRect.width() / mBigTicksCount) % 1)*mBigTicksCount;
			mForceLayout = false;
		} 
	} 
 
	@Override 
	protected void onDraw( Canvas canvas ) {
		super.onDraw( canvas );
		 
 
		if ( mShader != null ) {
			canvas.setDrawFilter( mFast );