Code example for BitmapShader

Methods: setLocalMatrix

0
			mDrawableRect.set(0 + mBorderWidth, 0 + mBorderWidth, mBorderRect.width() - mBorderWidth, mBorderRect.height() - mBorderWidth);
			mShaderMatrix.set(null);
			mShaderMatrix.setRectToRect(mBitmapRect, mDrawableRect, Matrix.ScaleToFit.FILL);
			break; 
		} 
		mBitmapShader.setLocalMatrix(mShaderMatrix);
	} 
 
	@Override 
	protected void onBoundsChange(Rect bounds) {
		Log.i(TAG, "onboundschange: w: " + bounds.width() + "h:" + bounds.height());
		super.onBoundsChange(bounds);
		 
		mBounds.set(bounds);
 
//		if (USE_VIGNETTE) { 
//			RadialGradient vignette = new RadialGradient( 
//					mDrawableRect.centerX(), mDrawableRect.centerY() * 1.0f / 0.7f, mDrawableRect.centerX() * 1.3f, 
//					new int[] { 0, 0, 0x7f000000 }, new float[] { 0.0f, 0.7f, 1.0f }, 
//					Shader.TileMode.CLAMP); 
//