从textview中获取bitmap

来源:互联网 发布:立体模拟软件 编辑:程序博客网 时间:2024/06/05 03:32


 Textview   tv=new TextView(context);
tv.setText("zhongge");
tv.setCompoundDrawablesIntrinsicBounds(drawable,null,null,null);
tv.setDrawingCacheEnabled(true);
Bitmap b=Bitmap.create(tv.getDrawingCache());
tv.destroyDrawingCache();

 Textview   tv=new TextView(context);
tv.setText("zhongge");
tv.setCompoundDrawablesIntrinsicBounds(drawable,null,null,null);
tv.setDrawingCacheEnabled(true);
Bitmap b=Bitmap.create(tv.getDrawingCache());
tv.destroyDrawingCache();

0 0