Android Image Rendering (III)-canvas screen Flushing

Source: Internet
Author: User

When drawing a dynamic image in the canvas, if a fixed background image is used, only one small genie is moving!

In this case, you have to re-draw the background image without frame, reducing the efficiency! I tried various methods and eventually failed!

If anyone has a good method, please provide it. Thank you!

 


The following are some examples of the exploration process:

1. An article about redrawing images. However, it can only be applied to the change of the genie at a fixed position, and the background is not changed!

If it is used on the mobile genie, the whole screen will be filled with the moving pictures and bugs of the genie.

Address: How to overwrite and refresh dirty rectangles in Android SurfaceView

 


2. About SuffaceView and other knowledge, canvas = sfh. lockCanvas (); and sfh. unlockCanvasAndPost (canvas); the canvas is constantly drawn up, so you need to overwrite the canvas and re-draw it!

Reference: SurfaceView, SurfaceHolder, SurfaceHolder. CallBackhttp: // www.bkjia.com/kf/201202/119622.html

 


3. tried to use the layer method, but the canvas. saveLayer () method does not know what it means!

4. Do not know how to use transparent rendering!

 


This article is just a record, not a solution ......

 

From Akai's column

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.