How to convert text of a TextView to bitmap in Android?

Try this

Add to your onCreate()

tv1.setDrawingCacheEnabled(true);

Then in your onClick()

tv1.buildDrawingCache();
iv.setImageBitmap(tv1.getDrawingCache());

http://developer.android.com/reference/android/view/View.html#buildDrawingCache(boolean)

http://developer.android.com/reference/android/view/View.html#getDrawingCache(boolean)

[EDIT]

The problem you now have is that you are trying to enable the drawing cache before tv1 exists.

You should do this:

TextView tv1 = (TextView) findViewById(R.id.txtV); 
tv1.setDrawingCacheEnabled(true);