Code example for BitmapShader

0
	 
			//paint.setXfermode(new PorterDuffXfermode(Mode.DARKEN)); 
	         
	        paint.setXfermode(null);
	        if(bitmap != null){
		        Shader bmpShader = new BitmapShader(
		        		Bitmap.createScaledBitmap(
		        				bitmap,
		        				width, 
		        				height, 
		        				false), 
	//	        		bitmap, 
		        		TileMode.CLAMP,
		        		TileMode.CLAMP);
		        paint.setShader(bmpShader);
	        } 
	         
	//        rect = new RectF(); 
	        rect.left = 1.0f;
	        rect.top = 1.0f;