How to draw Bitmap fast in onDraw() method in canvas android

前端 未结 3 1553
夕颜
夕颜 2020-12-30 05:47

I am trying to draw a marker on single tap method in android. when i draw the marker it will draw but it will take more time to draw i.e 30-40 milliseconds some times it tak

3条回答
  •  天命终不由人
    2020-12-30 06:07

    You should remove all BitmapFactory.decodeResource() calls from your draw() method. Decode bitmap only once and keep reference to it. Then just call canvas.drawBitmap() in your draw() method.

提交回复
热议问题