码迷,mamicode.com
首页 > 其他好文 > 详细

SurfaceHolder.Callback

时间:2015-08-21 22:51:34      阅读:215      评论:0      收藏:0      [点我收藏+]

标签:

Class Overview


A client may implement this interface to receive information about changes to the surface. When used with a SurfaceView, the Surface being held is only available between calls to surfaceCreated(SurfaceHolder) andsurfaceDestroyed(SurfaceHolder). The Callback is set with SurfaceHolder.addCallback method.

 

Public Methods


public abstract void surfaceChanged (SurfaceHolder holder, int format, int width, int height)

Added in API level 1

This is called immediately after any structural changes (format or size) have been made to the surface. You should at this point update the imagery in the surface. This method is always called at least once, aftersurfaceCreated(SurfaceHolder).

Parameters
holder The SurfaceHolder whose surface has changed.
format The new PixelFormat of the surface.
width The new width of the surface.
height The new height of the surface.

 

 

 

 

public abstract void surfaceCreated (SurfaceHolder holder)

Added in API level 1

This is called immediately after the surface is first created. Implementations of this should start up whatever rendering code they desire. Note that only one thread can ever draw into a Surface, so you should not draw into the Surface here if your normal rendering will be in another thread.

Parameters
holder The SurfaceHolder whose surface is being created.

 

 

public abstract void surfaceDestroyed (SurfaceHolder holder)

Added in API level 1

This is called immediately before a surface is being destroyed. After returning from this call, you should no longer try to access this surface. If you have a rendering thread that directly accesses the surface, you must ensure that thread is no longer touching the Surface before returning from this function.

Parameters
holder The SurfaceHolder whose surface is being destroyed.

SurfaceHolder.Callback

标签:

原文地址:http://www.cnblogs.com/happygirl-zjj/p/4749002.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!