What does the filter parameter to createScaledBitmap do?

前端 未结 4 1163
佛祖请我去吃肉
佛祖请我去吃肉 2020-11-29 17:13

The declaration of android.graphics.Bitmap.createScaledBitmap is

public static Bitmap createScaledBitmap
  (Bitmap src, int dstWidth, int dstHei         


        
4条回答
  •  悲哀的现实
    2020-11-29 17:56

    To expand on Karan's answer: As a general rule you won't see any difference if you're scaling your image down, but you will if you're scaling it up.

    Passing filter = false will result in a blocky, pixellated image.

    Passing filter = true will give you smoother edges.

    However, as EIYeante pointed out in the comments, you might still see a difference. This is their example image.

提交回复
热议问题