Reputation: 131
we had problems to draw nice & smooth images in java, because they were jagged. This code solved our problem:
g2d.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BILINEAR);
but now we are making the same app for android, but we have no clue how to apply similar interpolation or antialiasing to an android app.
(we use eclipse emulator)
Upvotes: 2
Views: 3801
Reputation: 3562
Use a Paint object.
create a Paint
object p
set p.setFilterBitmap(true)
pass the paint p
in your Canvas
's draw methods
This will activate (bilinear) filtering that will smoothen the "content" of the bitmap. You can also try to activate anti-aliasing with Paint.setAntiAlias(true)
, but that will affect only the outer edges of the bitmap (it is pretty handy for text though).
Upvotes: 5