Code example for BitmapShader

0
                                            0xFFCCCCCC, 0xFFFFFFFF }, 2, 2, 
                                            Bitmap.Config.RGB_565);
            mBG = new BitmapShader(bm,
                                   Shader.TileMode.REPEAT,
                                   Shader.TileMode.REPEAT);
            Matrix m = new Matrix();
            m.setScale(6, 6);
            mBG.setLocalMatrix(m);
        } 
 
        @Override protected void onDraw(Canvas canvas) {
            canvas.drawColor(Color.WHITE);
 
            Paint labelP = new Paint(Paint.ANTI_ALIAS_FLAG);
            labelP.setTextAlign(Paint.Align.CENTER);
 
            Paint paint = new Paint();
            paint.setFilterBitmap(false);
 
            canvas.translate(15, 35);