android中SurfaceView SurfaceHolder SurfaceHolder.Callback 关系 理解




(看了下1.5的平台的源代码,实话说不是很懂!汗颜。暂且随便记录下,以后再回头理解)

SurfaceView的解释:

Provides a dedicated drawing surface embedded inside of a view hierarchy。

Access to the underlying surface is provided via the SurfaceHolder interface, which can be retrieved by calling getHolder().

此类提供了函数:getHolder()返回一个SurfaceHolder对象,用于控制surface.

SurfaceHolder的解释:

Abstract interface to someone holding a display surface. Allows you to control the surface size and format, edit the pixels in the surface, and monitor changes to the surface

   即:它是一个用于控制surface的接口,它提供了控制surface 的大小,格式,上面的像素,即监视其改变的。

SurfaceHolder.Callback的解释:

A client may implement this interface to receive information about changes to the surface。

实现此接口的类,必须实现这几个函数:surfaceChanged()、surfaceCreated()、surfaceDestroyed()。这几个函数,会在相应的事件发生后,并调用,即surfaceview的函数会被调用。







http://apps.hi.baidu.com/share/detail/32312551

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值