What I got from your question, suppose you have an ImageView on your RelativeLayout, and you want the binding of this Imageview not to the entire RelativeLayout, than you have nothing to do.
Just use your code, instead of using relativelayout, using this view, which allows you to use ImageView in this case
ImageView v1 = (ImageView)findViewById(R.id.mImage); v1.setDrawingCacheEnabled(true); Bitmap bm = v1.getDrawingCache();
source share