ibrahimsaputra / achartengine

Automatically exported from code.google.com/p/achartengine
0 stars 0 forks source link

GraphicalView.toBitmap() is returning a non-antialiased image #98

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
The title says it all.  The report is antialiased on the device (1st screen 
shot), but after I extract the bitmap and convert it to a PDF (2nd file), it 
looks terrible.  I know it's not the PDF conversion process as the zoom buttons 
are nice and antialiased on the PDF also, so it must be toBitmap() doing 
something.

Original issue reported on code.google.com by zvasv...@gmail.com on 9 Jul 2011 at 7:33

Attachments:

GoogleCodeExporter commented 9 years ago
Adding : setDrawingCacheQuality(View.DRAWING_CACHE_QUALITY_HIGH); 

  public Bitmap toBitmap() {
    if (!isDrawingCacheEnabled()) {
      setDrawingCacheEnabled(true);
    }
    setDrawingCacheQuality(View.DRAWING_CACHE_QUALITY_HIGH);
    return getDrawingCache();
  }

Improved things, but it still not correct.

Original comment by chris.fo...@gmail.com on 15 Jul 2011 at 4:05

GoogleCodeExporter commented 9 years ago
Added Chris' suggestion. I will keep looking for an improvement.

Original comment by dandrome...@gmail.com on 16 Jul 2011 at 7:54

GoogleCodeExporter commented 9 years ago
I made some fixes and checked into SVN.
Exporting to .jpg files still brings some blur effects. However, exporting to 
.png brings a much better result. In this case, you will have to enable and set 
the background color, otherwise it will render a fully transparent one. See 
XYChartBuilder for an example.

Original comment by dandrome...@gmail.com on 20 Jul 2011 at 8:48