Android-on the understanding of Save and restore

Source: Internet
Author: User

Before all of this, let's take a look at the official documentation that explains the two functions.

Save ()

Subsequent calls to Translate,scale,rotate,skew,concat or ClipRect, Clippath would all operate as usual, and when the Balan Cing call to restore () is made, those calls'll be forgotten, and the settings that existed before the Save () would be Rei Nstated.

The approximate meaning is: "When the Save function is called, panning, zooming, and rotating the canvas is not the same as usual, but." After you call the Restore () method, the state of the canvas before the Save method call will be restored.

In layman's terms, when I call the Save method, I will save the current state of the canvas, save this state, I do the various transformations, in fact, I in these transformations, the purpose is to change the canvas of an element of the state, not the whole canvas state, so after the transformation is complete, I restored the state of my previously saved canvas by calling the Restore method, so that any subsequent images drawn on the canvas would not be affected by this change.

One word:

Save saves Canvas state

Restore restores the saved canvas state of Save

Android-on the understanding of Save and restore

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.