Android Canvas.DrawBitmap without blurring/AntiAliasing?

前端 未结 1 1829
[愿得一人]
[愿得一人] 2021-02-09 20:41

I\'m trying to make an android game using sprites, (or very pixelated characters, backgrounds etc.). I draw them on the canvas like so...

matrix.preScale(xrat,yrat

相关标签:
1条回答
  • 2021-02-09 21:31

    Create a new Paint to use when drawing the bitmaps with the settings:

    Paint drawPaint = new Paint();
    drawPaint.setAntiAlias(false);
    drawPaint.setFilterBitmap(false);
    

    Filtering I believe is on by default and will attempt to smooth out bitmaps when drawn scaled up.

    0 讨论(0)
提交回复
热议问题