Condividi tramite


Surface Class

Definition

Handle onto a raw buffer that is being managed by the screen compositor.

[Android.Runtime.Register("android/view/Surface", DoNotGenerateAcw=true)]
public class Surface : Java.Lang.Object, Android.OS.IParcelable, IDisposable, Java.Interop.IJavaPeerable
[<Android.Runtime.Register("android/view/Surface", DoNotGenerateAcw=true)>]
type Surface = class
    inherit Object
    interface IParcelable
    interface IJavaObject
    interface IDisposable
    interface IJavaPeerable
Inheritance
Surface
Attributes
Implements

Remarks

Handle onto a raw buffer that is being managed by the screen compositor.

A Surface is generally created by or from a consumer of image buffers (such as a android.graphics.SurfaceTexture, android.media.MediaRecorder, or android.renderscript.Allocation), and is handed to some kind of producer (such as android.opengl.EGL14#eglCreateWindowSurface(android.opengl.EGLDisplay,android.opengl.EGLConfig,java.lang.Object,int[],int) OpenGL, android.media.MediaPlayer#setSurface MediaPlayer, or android.hardware.camera2.CameraDevice#createCaptureSession CameraDevice) to draw into.

<strong>Note:</strong> A Surface acts like a java.lang.ref.WeakReference weak reference to the consumer it is associated with. By itself it will not keep its parent consumer from being reclaimed.

Java documentation for android.view.Surface.

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Constructors

Surface(IntPtr, JniHandleOwnership)

A constructor used when creating managed representations of JNI objects; called by the runtime.

Surface(SurfaceControl)

Create a Surface associated with a given SurfaceControl.

Surface(SurfaceTexture)

Create Surface from a SurfaceTexture.

Fields

ChangeFrameRateAlways
Obsolete.

Change the frame rate even if the transition is going to be non-seamless, i.

ChangeFrameRateOnlyIfSeamless
Obsolete.

Change the frame rate only if the transition is going to be seamless.

FrameRateCompatibilityDefault
Obsolete.

There are no inherent restrictions on the frame rate of this surface.

FrameRateCompatibilityFixedSource
Obsolete.

This surface is being used to display content with an inherently fixed frame rate, e.

Gpu
Hardware
Hidden
NonPremultiplied
PushBuffers
Secure
SuraceFrozen
SurfaceBlurFreeze
SurfaceDither
SurfaceFrozen
SurfaceHidden

Properties

Class

Returns the runtime class of this Object.

(Inherited from Object)
Creator
Handle

The handle to the underlying Android instance.

(Inherited from Object)
IsValid

Returns true if this object holds a valid surface.

JniIdentityHashCode (Inherited from Object)
JniPeerMembers
PeerReference (Inherited from Object)
ThresholdClass

This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.

ThresholdType

This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.

Methods

ClearFrameRate()

Clears the frame rate which was set for this surface.

Clone()

Creates and returns a copy of this object.

(Inherited from Object)
DescribeContents()

Describe the kinds of special objects contained in this Parcelable's marshalled representation.

Dispose() (Inherited from Object)
Dispose(Boolean) (Inherited from Object)
Equals(Object)

Indicates whether some other object is "equal to" this one.

(Inherited from Object)
Freeze()
GetHashCode()

Returns a hash code value for the object.

(Inherited from Object)
Hide()
JavaFinalize()

Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.

(Inherited from Object)
LockCanvas(Rect)

Gets a Canvas for drawing into this surface.

LockHardwareCanvas()

Gets a Canvas for drawing into this surface.

Notify()

Wakes up a single thread that is waiting on this object's monitor.

(Inherited from Object)
NotifyAll()

Wakes up all threads that are waiting on this object's monitor.

(Inherited from Object)
ReadFromParcel(Parcel)
Release()

Release the local reference to the server-side surface.

SetAlpha(Single)
SetFlags(Int32, Int32)
SetFrameRate(Single, Int32, Int32)

Sets the intended frame rate for this surface.

SetFrameRate(Single, Int32)

Sets the intended frame rate for this surface.

SetFreezeTint(Int32)
SetHandle(IntPtr, JniHandleOwnership)

Sets the Handle property.

(Inherited from Object)
SetLayer(Int32)
SetMatrix(Single, Single, Single, Single)
SetOrientation(Int32, SurfaceOrientation)
SetPosition(Int32, Int32)
SetSize(Int32, Int32)
SetTransparentRegionHint(Region)
Show()
ToArray<T>() (Inherited from Object)
ToString()

Returns a string representation of the object.

(Inherited from Object)
Unfreeze()
UnlockCanvas(Canvas)
Obsolete.

This member is deprecated.

UnlockCanvasAndPost(Canvas)

Posts the new contents of the Canvas to the surface and releases the Canvas.

UnregisterFromRuntime() (Inherited from Object)
Wait()

Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>.

(Inherited from Object)
Wait(Int64, Int32)

Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>, or until a certain amount of real time has elapsed.

(Inherited from Object)
Wait(Int64)

Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>, or until a certain amount of real time has elapsed.

(Inherited from Object)
WriteToParcel(Parcel, ParcelableWriteFlags)

Flatten this object in to a Parcel.

Explicit Interface Implementations

IJavaPeerable.Disposed() (Inherited from Object)
IJavaPeerable.DisposeUnlessReferenced() (Inherited from Object)
IJavaPeerable.Finalized() (Inherited from Object)
IJavaPeerable.JniManagedPeerState (Inherited from Object)
IJavaPeerable.SetJniIdentityHashCode(Int32) (Inherited from Object)
IJavaPeerable.SetJniManagedPeerState(JniManagedPeerStates) (Inherited from Object)
IJavaPeerable.SetPeerReference(JniObjectReference) (Inherited from Object)

Extension Methods

JavaCast<TResult>(IJavaObject)

Performs an Android runtime-checked type conversion.

JavaCast<TResult>(IJavaObject)
GetJniTypeName(IJavaPeerable)

Applies to