How to convert a AChartEngine chart to bitmap

Posted by user2137817 on Stack Overflow See other posts from Stack Overflow or by user2137817
Published on 2013-04-05T20:43:30Z Indexed on 2014/06/07 15:25 UTC
Read the original article Hit count: 339

Filed under:
|
|

I want to convert a line graph I made with AChartEngine lib to bitmap.How should I do?I didn't found on the net anything that can help. Is the toBitmap() method suitable?if yes then how to use it?

Update: I used this method :

 public static Bitmap loadBitmapFromView(View v) {  
v.setDrawingCacheEnabled(true);
v.layout( 0,0,800,600);
v.setDrawingCacheQuality(View.DRAWING_CACHE_QUALITY_HIGH);
v.buildDrawingCache();
v.getDrawingCache();
 Bitmap bmp = Bitmap.createBitmap(800,600, Bitmap.Config.ARGB_8888);
v.setDrawingCacheEnabled(false);
return bmp; }

and saved the result in a png file but all I got is an empty file !

© Stack Overflow or respective owner

Related posts about android

Related posts about bitmap