Code example for BitmapShader

0
 
	private void init( Bitmap bitmap ) {
		mBitmap = bitmap;
 
		if ( mBitmap != null ) {
			mShader = new BitmapShader( mBitmap, TileMode.REPEAT, TileMode.CLAMP );
			mPaint.setShader( mShader );
		} 
	} 
 
	/* 
	 * (non-Javadoc) 
	 *  
	 * @see android.graphics.drawable.Drawable#draw(android.graphics.Canvas) 
	 */ 
	@Override 
	public void draw( Canvas canvas ) {
		if ( null != mBitmap ) {
			copyBounds( mRect );
			canvas.drawPaint( mPaint );
Experience pair programming with AI  Get Codota for Java