Hi, I am writing a custom view and for optimization purposes, I draw some 
static part of the view in a Bitmap. Unfortunately, the quality of the 
rendering when using an offscreen bitmap is noticeably less compared to 
rendering into the view's canvas bitmap. Here are two screenshots showing 
the difference

Rendering into view's Canvas:

<https://lh5.googleusercontent.com/-wSjtLmhUgz8/UQZV96LTo6I/AAAAAAAAAEM/r9saff_8dlM/s1600/01_view_canvas.png>
Rendering into a Bitmap Canvas

<https://lh3.googleusercontent.com/-jVuFcXhAf7g/UQZWK7NBNfI/AAAAAAAAAEU/0AfCGfQMudU/s1600/02_bitmap_canvas.png>
The difference is most noticeable at the horizontal black line. 
The anti-aliasing algorithm seems to affect more pixels (is wider). 

The drawing code is the same in both cases, and the offscreen canvas is 
created like this

            final Bitmap tempBitmap = Bitmap.createBitmap(getWidth(), 
getHeight(), Bitmap.Config.ARGB_8888);
            final Canvas tempCanvas = new Canvas(tempBitmap);

Any ideas on how to get the same rendering in the offscreen canvas as in 
the view's ?

Thank you

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group, send email to 
[email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to