android image drawing of three canvas refresh problem recording

  • 2020-05-09 19:16:32
  • OfStack

When drawing a dynamic in canvas, if a fixed background image is used, only a small Sprite is moving!
In this case, you have to redraw the background picture in no frame, which reduces the efficiency! Tried all kinds of methods, but failed in the end!
If someone has a good method, can offer 1, thank you!

Here are some to share during the exploration process:
1, 1 about the image redrawing article, but only applies to the Sprite in the fixed position change, the background is not changed!
If used on a moving Sprite, the entire screen will be filled with moving Sprite images, bug.
Address: Android SurfaceView drawing overlay refresh and dirty rectangle refresh methods

2. Some knowledge about SuffaceView, canvas = sfh.lockCanvas(); With sfh. unlockCanvasAndPost (canvas); Between the canvas is constantly drawn up, so you need to cover repainting can!
Reference: SurfaceView SurfaceHolder, SurfaceHolder CallBack

3. Tried using layers, but the canvas.saveLayer () method doesn't know what it means!

4, transparent drawing, do not know how to!
This article is just a note 1, not a solution...

Related articles: