Android Guides | Samples

Android.Views.ISurfaceHolder

Abstract interface to someone holding a display surface.

See Also: ISurfaceHolder

Syntax

[Android.Runtime.Register("android/view/SurfaceHolder", "", "Android.Views.ISurfaceHolderInvoker")]
public interface ISurfaceHolder : IJavaObject, IDisposable

Remarks

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. This interface is typically available through the SurfaceView class.

When using this interface from a thread other than the one running its SurfaceView, you will want to carefully read the methods ISurfaceHolder.LockCanvas and ISurfaceHolderCallback.SurfaceCreated(ISurfaceHolder).

[Android Documentation]

Requirements

Namespace: Android.Views
Assembly: Mono.Android (in Mono.Android.dll)
Assembly Versions: 0.0.0.0
Since: Added in API level 1

The members of Android.Views.ISurfaceHolder are listed below.

Public Properties

[read-only]
IsCreatingBoolean. Use this method to find out if the surface is in the process of being created from Callback methods.
[read-only]
SurfaceSurface. Direct access to the surface object.
[read-only]
SurfaceFrameRect. Retrieve the current size of the surface.

Public Methods

AddCallback(ISurfaceHolderCallback)
Add a Callback interface for this holder.
LockCanvas() : Canvas
Start editing the pixels in the surface.
LockCanvas(Rect) : Canvas
Just like ISurfaceHolder.LockCanvas but allows specification of a dirty rectangle.
RemoveCallback(ISurfaceHolderCallback)
Removes a previously added Callback interface from this holder.
SetFixedSize(Int32, Int32)
Make the surface a fixed size.
SetFormat(Format)
Set the desired PixelFormat of the surface.
SetKeepScreenOn(Boolean)
Enable or disable option to keep the screen turned on while this surface is displayed.
SetSizeFromLayout()
Allow the surface to resized based on layout of its container (this is the default).
SetType(SurfaceType)
Sets the surface's type.
UnlockCanvasAndPost(Canvas)
Finish editing pixels in the surface.