Principle of surface in android

Source: Internet
Author: User

 

In android, there are three classes available: Surface, SurfaceView, and SurfaceHolder.

 

Surface class: each Surface corresponds to a separate video buffer in the system. The Surface is a description of the buffer. You can use the method provided by the Surface class to draw directly on it.

 

SurfaceView class: used to create and destroy a display area and process the relationship with other views.

 

SurfaceHolder class: this class is an interface, mainly used to define its corresponding Surface method.

 

The GUI system uses SurfaceView to operate the Surface, and the application uses SurfaceHolder to operate the Surface. Surface provides the developer with an interface lockCanvas () for obtaining the canvas. This method returns the canvas corresponding to the Surface. The subroutine can be freely used to meet the needs of the application interface.

 

From Yanyun'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.