Android.Views.TextureView.LockCanvas Method

Syntax

[Android.Runtime.Register("lockCanvas", "()Landroid/graphics/Canvas;", "GetLockCanvasHandler")]
public virtual Android.Graphics.Canvas LockCanvas ()

See Also

TextureView.LockCanvas(Android.Graphics.Rect)
TextureView.UnlockCanvasAndPost(Android.Graphics.Canvas)

Returns

Documentation for this section has not yet been entered.

Remarks

Start editing the pixels in the surface. The returned Canvas can be used to draw into the surface's bitmap. A null is returned if the surface has not been created or otherwise cannot be edited. You will usually need to implement NoType:android/view/TextureView$SurfaceTextureListener;Href=../../../reference/android/view/TextureView.SurfaceTextureListener.html#onSurfaceTextureAvailable(android.graphics.SurfaceTexture, int, int) to find out when the Surface is available for use.

The content of the Surface is never preserved between unlockCanvas() and lockCanvas(), for this reason, every pixel within the Surface area must be written. The only exception to this rule is when a dirty rectangle is specified, in which case, non-dirty pixels will be preserved.

This method can only be used if the underlying surface is not already owned by another producer. For instance, if the TextureView is being used to render the camera's preview you cannot invoke this method.

[Android Documentation]

Requirements

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