First get the height and width of the bitmap,
final int height= bitmap.getHeight() ;
final int width= bitmap.getWidth();
float h= (float) height;
float w= (float) width;
Now lets the position of your rectangle is ( newLeft, newTop ) and height, width is newHeight and newWidth respectively
Now set the position and scaling factor to a matrix object
Matrix mat=new Matrix();
mat.setTranslate( newLeft, newTop );
mat.setScale(newWidth/w ,newHeight/h);
now draw your bitmap with the matrix
canvas.drawBitmap(bitmap, mat, new paint());
Now your bitmap will fill the rectangle..
try it, all the best.!