2

I try to resize an image like this:

aPaint.setAntiAlias(true); // Enabling this flag will cause all draw operations that support antialiasing to use it.
aPaint.setFilterBitmap(True); // enable bilinear sampling on scaled bitmaps. If cleared, scaled bitmaps will be drawn with nearest neighbor sampling, likely resulting in artifacts.
apaint.setDither(true); // Enabling this flag applies a dither to any blit operation where the target's colour space is more constrained than the source.
aCanvas.drawBitmap(aBitmap, aJSrcRect, aJDestRectf, apaint);

But I don't have a very good antialised image (it's antialiased, but not very good). Here is an image showing my problem

enter image description here

What can i do to increase the quality of the antialias under android ?

Omkar
  • 3,040
  • 1
  • 22
  • 42

1 Answers1

1

For antialias effect, you can try to create a Paint like this:

Paint paint= new Paint();
paint.setFlags(Paint.ANTI_ALIAS_FLAG);
paint.setAntiAlias(true);
paint.setFilterBitmap(true); 

Finally apply paint on canvas with:

canvas.drawBitmap(mBitmap, 0.f, 0.f, paint)
Axel
  • 3,331
  • 11
  • 35
  • 58
  • paint.setAntiAlias(true); is just a helper for paint.setFlags(Paint.ANTI_ALIAS_FLAG); :( as you see in the sample code i gave it's already what i did :( –  Sep 15 '17 at 12:58