Bitmap not drawn anti-aliased

后端 未结 5 1184
遥遥无期
遥遥无期 2020-12-05 00:50

I have a custom View that always draws a Bitmap at a certain rotation. I overwrite the onDraw method, rotate the Canvas a

5条回答
  •  情书的邮戳
    2020-12-05 01:22

    I had the same problem, and tried all of these fixes. What finally worked is globally disabling hardware acceleration in the AndroidManifest.xml file:

     
    

    and then disabling inSampleSize when I loaded my image bitmap, so that (I presume) the image would load at a high enough quality to avoid any zigzags, and then, for my actual ImageView, using the above advice: setting the layer type to View.LAYER_TYPE_SOFTWARE, with a paint object with the filter bitmap set to true (as above) and anti-aliasing on.

提交回复
热议问题